diff --git a/powerline/lib/tree_watcher.py b/powerline/lib/tree_watcher.py index b2f11fb7..7b932e42 100644 --- a/powerline/lib/tree_watcher.py +++ b/powerline/lib/tree_watcher.py @@ -50,6 +50,10 @@ class INotifyTreeWatcher(INotify): ''' Add watches for this directory and all its descendant directories, recursively. ''' base = realpath(base) + # There may exist a link which leads to an endless + # add_watches loop or to maximum recursion depth exceeded + if not top_level and base in self.watched_dirs: + return try: is_dir = self.add_watch(base) except OSError as e: