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

C-l rebinding not working in bash to clear screen #297

Closed
noahmoss opened this issue Jun 13, 2021 · 6 comments
Closed

C-l rebinding not working in bash to clear screen #297

noahmoss opened this issue Jun 13, 2021 · 6 comments

Comments

@noahmoss
Copy link

Hi, first of all thanks for the great work on this plugin! I've been using it for a long time and it makes my vim+tmux workflow seamless!

I just added bind C-l send-keys 'C-l' to my .tmux.conf to try to restore the ability to clear the screen, per the instructions in the readme. However, it doesn't seem to be working -- typing <prefix> C-l just inserts ^L into the terminal. I've tried it in a clean bash environment without my .bash_profile and .bashrc and it still doesn't work, but it does work in zsh, so maybe it's a bash-specific issue? Thanks for any help you can provide!

@christoomey
Copy link
Owner

Hmm, interesting. Any changes to your terminal or she’ll recently?

Also, can you test the following:

  1. open two panes, navigate to the first pane (pane 0 in tmux numbering)
  2. Run tmux send-keys -t 1 ‘C-l’ to see if sending Ctrl l works in general?

@noahmoss
Copy link
Author

@christoomey No changes I can think of that would affect this (but I've never had it working before, I only recently tried adding this).

I'm assuming you mean 'C-l' rather than ‘C-l’ (straight vs curly quotes)? If so I also just see ^L printed.

@christoomey
Copy link
Owner

I'm assuming you mean 'C-l' rather than ‘C-l’ (straight vs curly quotes)?

Yep, definitely straight quotes. I was typing on my phone, thus the more typographic quotes 😄

It looks as the Ctrl-l is being printed rather than interpreted, which is interesting. Can you test hitting Ctrl-l outside of tmux? This feels like a lower-level / shell thing rather than a tmux thing or something specific to the plugin, but hard to tell.

@noahmoss
Copy link
Author

Ah yeah you're right, outside of tmux it still just prints ^L. Weird, guess it has nothing to do with the plugin, I'll have to dig into that more myself (unless you have any ideas).

I'm also having a separate problem where C-\ isn't working to go to the previous pane when I'm in a tmux pane, though it does work when I'm in vim and switching back to tmux. .tmux.conf is, again, exactly as in the readme. Do you know what the problem might be here? I can open a separate issue for this if you'd prefer.

@christoomey
Copy link
Owner

I'm also having a separate problem where C-\ isn't working to go to the previous pane

If you can open a separate issue with any other info you can provide, that would be great.

@noahmoss
Copy link
Author

For anyone else who comes across this -- I realized this was broken because I have vi mode turned on in bash, with set -o vi, which apparently meant that C-l is not bound as expected. Adding these lines to my bashrc made it work properly:

bind -m vi-command 'Control-l: clear-screen'
bind -m vi-insert 'Control-l: clear-screen'

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