ranger_tmux
ranger_tmux copied to clipboard
Feature request: Also clear when changing directories
Hi
It's really annoying to see the terminal clutter up with cd's, could there be anything done about this?
Thank you in advance
Hi,
I agree it's a bit annoying.
I've not found a clean way to do this which works across different shells. Things I've explored:
-
Forcibly change the shell's cwd using gdb (see here) This causes some shells to behave unexpectedly (e.g.
zsh
does not update the prompt) -
Create a background task for each shell session which listens for change directory commands sent to a socket, and change the current directory when a command is received. This should work pretty well, but would require the user to configure their shell in addition to
ranger
&tmux
.
The second option might be the way to go.
If you have any more ideas how this could be achieved, let me know!
I've had another idea - it might be possible to clear the previous line in the terminal by sending escape sequences
The above works pretty well actually.
I've implemented this in a branch so you can test it if you like: https://github.com/joouha/ranger_tmux/tree/feature/quiet-cd
Ow that's ok, I've actually managed to make it work on my own pretty easily by adding a clear at the end of the send-keys
in utils.py
tmux("send-keys", "-t", pane_id, ' cd "{}"'.format(path), "Enter", "clear" , "Enter")'
worked for me, after i got it to reinstall