Skip to content
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

Feature request: Also clear when changing directories #9

Open
excited-bore opened this issue Jan 16, 2023 · 4 comments
Open

Feature request: Also clear when changing directories #9

excited-bore opened this issue Jan 16, 2023 · 4 comments

Comments

@excited-bore
Copy link

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

@joouha
Copy link
Owner

joouha commented Jan 18, 2023

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!

@joouha
Copy link
Owner

joouha commented Jan 18, 2023

I've had another idea - it might be possible to clear the previous line in the terminal by sending escape sequences

@joouha
Copy link
Owner

joouha commented Jan 18, 2023

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

@excited-bore
Copy link
Author

excited-bore commented Jan 18, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants