0

My environment is Fedora20 (32-bit) + Yakuake + fish + tmux.

Months ago, I started to use tmux, it is a great terminal multiplexer, but the scrollback (Use prefix then PageUp to scroll back) is not working as expected, the history limit is always under 2000 (around 1980 on the right above corner) even if I already set the scrollback limit to "unlimited scrollback" in Yakuake Setting.

Finally I could take it anymore and started to goole it for solution, found out that I could put set -g history-limit 30000 int my tmux.conf file, then check again, it worked, but I realized that every time I typed C-l to clear the screen(and I use it a lot), the scrollback history will be only under/around 30.

Then I found out at How do i clear tmux screen while tailing logs? that I could put bind l send-keys -R into .tmux.conf and use prefix-l to clear the terminal history buffer temporarily and still be able to scroll back, it worked just as I wanted. But What I really want is I use only C-l to do the trick without the prefix key, replacing the shell built-in C-l to do it...

Update:

Short ask, after setting a bind in .tmux.conf, in tmux, you have to type the prefix key before typing that key, then how to bind a key without the need to add the prefix key by default??

Community
  • 1
  • 1
CodyChan
  • 1,776
  • 22
  • 35

1 Answers1

1

In order to bind a key without the need to add the prefix, use the -n flag for the tmux bind command.

Here's the example that should be put in tmux.conf:

bind -n C-l display-message 'foo'

The example binding is triggered when Ctrl-l is pressed (no prefix) and it displays message 'foo' in the tmux prompt.

All that said, be careful & conservative with setting these "direct" key bindings because the key will become unusable for any other terminal program.