chdir to the displayed directory

This isn't necessary for the actual operation of ncdu,
but helps tools like screen/tmux open a new terminal in the currently
viewed directory, which is what people probably expect.
This commit is contained in:
Chris West (Faux) 2015-11-15 13:18:16 +00:00 committed by Yorhel
parent 936a9446a8
commit 20e1fbce46

View file

@ -189,6 +189,10 @@ static void dirlist_fixup() {
void dirlist_open(struct dir *d) {
dirlist_par = d;
/* not necessary for any ncdu functionality,
* but enables screen/tmux to work out our cwd */
chdir(getpath(dirlist_par));
/* set the head of the list */
head_real = head = d == NULL ? NULL : d->sub;