How to increase copy limit in tmux 3.1? - tmux

When I go into copy mode in tmux 3.1 with CTRL-B [, I am able to copy/paste only about 350 lines of text. I want to increase this limit. What do I need to add to my .tmux.conf file?
NOTES:
yes, variants of this question have already been asked on SO and sister sites, but all of the answers I have come across are ancient and don't work; surely there's a simple way to increase this buffer in tmux 3.1+
I'm using tmux 3.1c from homebrew on MacOS v11.2.2, iTerm2 v3.4.4. Oddly, this limit only seems to apply with iTerm2 locally on my Mac; when I ssh into a remote Ubuntu server (tmux 3.1b built from source), also on iTerm2, the limit seems to no longer apply. (And I use the exact same .tmux.conf file on both.)

check this out, you can put this line in your .tmux.conf file:
set-option -g history-limit 1000
be aware, if you set a very large default value, it can easily consume lots of RAM if you create many panes.
you can increase 1000 up to any number according to your RAM
don't do this because it allocates a lot of lines (and hence memory) to all windows, causing your device to cripple more history over time. 😅
set -g history-limit 999999999

Related

Tmux split window command not working after brew upgrade

I wanted to run 'brew update' but run 'brew upgrade'.
After that, my tmux stop working on some functionalities.
For example, I cannot split windows. I have already tried using shortcut (Prefix-%), terminal command (tmux split-window), or tmux command (Prefix-:split-window). Sometimes the terminal divides the window for a fraction of time and then the new pane fades out. Sometimes nothing happens.
If tmux is detached, I can attach with tmux attach but some other commands are not working. For example, if I run tmux new-session -As "foo", it returns the string [exit] and if I inspect the return (echo $?), it returns 0.
I have already tried to run tmux without any configuration in case my tmux.conf have some problems. But when I run tmux -f /dev/null, it returns the string [exit] and if I inspect the return (echo $?), it returns 0.
The problem is that I am not sure if the problem is with tmux itself (it was upgraded to 3.2a - and I did not remember which version it was before) or if the problem is with another program or with the fact I am running with Mac M1 processor, that causes me problems in a bunch of situations.
I have already tried to downgrade tmux but there are not many materials on how to do that I the ones that I tried did not work. So I give up, especially because I was not sure if this would solve the problem.
In summary, I need some help at least to know how to best debug the problem.
Thanks!
I had the exact same problem and could fix it by just restarting my tmux session. Dettaching and reattaching is not enough.

How do bind Command-b to move back by a word in iTerm/ZSH?

I just installed iTerm and have ZSH because I have Catalina.
I used to have Bash and Catalina instead, and an iTerm installation on a different laptop that I have gradually configured over the years.
So I can't remember the specific steps I took to get ⌘-b/⌘-f to work as backward-word/forward-word in Bash. And trying to search for a combination of possible keywords (binding, mapping, emacs mode, zsh, iterm, etc.) didn't yield an answer to this question.
I copied over the .inputrc from my previous machine but that hasn't helped.
What are the steps necessary here? Is it a combination of Zsh settings along with iTerm key binding settings?

Different multiline prompt behavior using zsh + oh-my-zsh + iTerm2 + High Sierra

On the latest macOS High Sierra, iTerm2, zsh, and oh-my-zsh, I've noticed that tab completion when using a multiline prompt is no longer flushing correctly. I've verified this issue on two separate machines and I'm wondering:
if you can also verify this is an issue for you
how to start zeroing in on which system is causing this issue
if you know of a workaround
Example prompt:
PROMPT="$(virtualenv_info) %n at %~ on %M $(vcs_info)
%(!.#.$) "
Which produces:
(myvirtualenv) me at ~/source/some-repo on localhost [master]
$
Issue:
When attempting tab completion for commands like ls or cd, hitting TAB to see subdirectories causes the subsequent print to overwrite the lines containing the prompt:
(myvirtualenv) me at ~/source/some-repo on localhost [master]
$ ls some-f...
Hit TAB
(myvirtualenv) me at ~/source/some-repo on localhost [master]
$ ls some-folder/
Hit TAB again
some-folder/
folder-1/ folder-2/ folder-3/
The above output overwrites the lines containing the prompt. I've tried setting locale info and different kinds of newlines. This multiline prompt still works correctly on an older version of zsh running on a CentOS AWS box I have, and tomorrow I can confirm whether it's still working on a < 10.13 macOS machine.
I was able to narrow this down by deduction to the COMPLETION_WAITING_DOTS setting, which I've now found corroborated in this oh-my-zsh issue. It appears this code behaves differently in High Sierra, so I'll look into that for a workaround or a possible fix. For now my workaround is removing my COMPLETION_WAITING_DOTS="true" setting.

tmux homebrew C-B prefix not working on macosx

I am new to tmux. I use screen for remote session. After reading a few tutorials online I am very surprise. So I want to give it a try as tmux is easier to use and more customizable for me as a developer.
I am on macosx sierra and install tmux via homebrew but after creating a session I used C-B prefix command for example C-B % to split but it did not work.
Can anyone tell me how to debug this or is there any setting for this to work?
ps: I also try a few combination cmd+b+% ,...

Start 'tmux' before Vim. The X Window system is required to run R in an external terminal

I am using a previous version of Vim-R-Plugin and pretty comfortable about its settings. Recently I upgraded the Linux system and got message never before "Start 'tmux' before Vim. The X Window system is required to run R in an external terminal.". The issue is, if I start tmux manually, the vim background were also changed weirdly and further ,rc will start a R console in a split window rather than a new window. Does somebody know the reasons and how to fix it?
This is due to styles and handling of tmux 'emulated terminal'.
At first try to simply run
tmux -2
If it does not help try add in ~/.tmux.conf:
set -g default-terminal "screen-256color"

Resources