-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep working directory of broot process in sync with directory of its currently focused panel #813
Comments
I tried it: #814 |
I think Open terminal here use-case is completely common in our universe and even Windows Explorer has it.| Files manager which keeps their CWD in sync with their currently displayed folder:
kitty - maybe the most popular terminal (with inbuilt multiplexer) - also supports opening a new pane/tab/window in CWD of the process currently controlling terminal via dedicated commands
these are not accidental commands since even their names' suffix I've been seeing this functionality for many years and came to think it is pretty standard but maybe these terminals&multiplexers and file-managers are pretty niche themself. Having it supported by broot would make opening new tab/pane/window in currently displayed folder in these terminals completely zero configuration. Alternative is for user to define separate verbs like:
-Sales pitch over- Hey, I really don't know how common it is. Broot is the first interactive file-manager-like (somewhat) application I encountered which does not sync its CWD. I can happily use your PR (haven't tried it yet btw.) as a patch during every and each broot upgrade. It's almost zero effort for me with Nix(OS)/home-manager. Is it something which general audience may expect? IDK. Might there by any drawbacks? I don't think so but I really don't know. :( |
I'll do it. Main question is should it be opt-in or opt-out (i.e. can it have a cost or negative side effects ?). |
I made it opt out. |
@WizardUli Can you try the PR before I merge it ? |
This feature is available with the just released 1.31.0 |
Oh wow, thanks for this! I was curious if it obviated the need for the shell wrapper, and I think it doesn't, but it's very welcome for use within tmux, where opening a new pane/window/split/whatever always uses the broot-current folder. I already had these related verbs, replacing two tmux binds just in the context of broot: {
key: f4
shortcut: z
external: tmux splitw
set_working_dir: true
leave_broot: false
}
{
key: ctrl-t
shortcut: tab
external: tmux new-window -c {directory}
set_working_dir: true
leave_broot: false
} And now I can get rid of them entirely, as using the tmux binds will work the same way. |
Hello. I'd like to suggest to keep broot's main process working directory in sync with the directory it is currently displaying just like the famous nnn file browser does (where you can literally just
ls -la /proc/<pid of specific nnn process>/cwd
to get the currently opened directory in that specific nnn instance).This would have immediate benefits at least in:
(Caveat: Zellij seems to be using CWD of the oldest still running process in the currently focused pane so nnn (or broot in the future) must be running in that pane directly without underlying shell like bash or fish (which is quite normal and common anyway in Zellij). Alacritty is more inteligent and uses CWD of the current TTY controlling process.)
The text was updated successfully, but these errors were encountered: