Is there a way to do clear-history in all panes of all tmux sessions?
Tmux gets super slow after a couple days and I figure it might be because of the long scrollback buffers in a bunch of sessions.
Using Tmux 2.5 on macOS with iTerm2.
Related:
How can I clear scrollback buffer in Tmux?
Easiest way would be to set the window history limit to some small number, so every new pane will have a maximum history. In your .tmux.conf file you can set the window history limit with:
set -g history-limit 1024
Related
So I created a trap to check if my terminal (both kitty and iTerm) are registering the change:
trap ‘echo $COLUMNS’ WINCH
And they are. But none of them attempt to redraw my prompt, neither from re issuing the $PROMPT_COMMAND or by printing $PS1. So now I’ve got two options as far as I can tell.
Use the trap to either issue a ctrl-c or similar or to somehow use tput to move the cursor around and manually redraw the prompt.
So how can I best redraw the prompt when a window resize happens?
I am using iterm on my macbook and want to split it into multiple panes (both horizontally and vertically) like conemu. My end goal is to be able to type different git commands in each pane (conemu example). Is iterm capable of doing this?
If it's not possible with iterm, what are my other options?
I know you can "cmd + d" to split but then I only get the same terminal in 2 different panes.
Are you sue you are using iTerm? Any way I'll sugest to forget about it and use Terminal, for a macOS experience. iTerm remembers me of Linux, you have all the options but you'll spend all day configuring it and when finally is ok then some bug will hit and take your peace of mind How to exit alternate screen scrolling on iTerm2 Vim?.
This might help https://apple.stackexchange.com/questions/6504/how-do-split-panes-in-terminal-work. And #BennyPowers answer at https://superuser.com/questions/55459/how-to-get-vertical-split-of-terminal-in-mac-to-execute-different-actions.
I use the macOS native way to split vertically and GNU Screen (which came with macOS) to split horizontally. Execute screen then C-a S (to split into two regions), C-a TAB (to swith to the other region) and C-a c (to open bash).
You can even resize it with C-a : then type resize 10 i.e. and for more man screen.
When its done you exit andC-a k to destroy the window.
For completeness. A lot of people say tmux https://github.com/tmux/tmux/wiki is a better alternative to GNU Screen. I never tried afraid of the same experience I had with iTerm 2.
I searched online for how to set the scrollback buffer size for lxTerminal, but the man page is mysteriously quite simple, missing any useful information. Is there a way to configure lxterminal to use a large scrollback buffer?
It's configurable via the preferences dialog
in the Display tab (where you can scroll the number up, or just fill in a large number which will be limited to 100000):
Regarding documentation - it uses VTE (same comment applies).
I have been using tmux for some time now and really like the internal copy buffer. I frequently find myself wanting to copy a command between panes but haven't really found an easy way of doing this.
What I would like is some equivalent of Ctrl+K that moves the data into the tmux buffer. Is there any way of doing this with one key binding? As it is, I could probably get it to work with two (first do Ctrl+K, then a keybinding that via xclip moves clipboard into tmux buffer), but I really would like to be able to do it quickly with just one hotkey.
EDIT:
I am running bash as shell in tmux, with evilvte as terminal in Kubuntu 12.04.
Not sure if this is zsh, iterm2 or the interaction between them.
Trying to change the number of recallable lines in the terminal - not the command history, the output history.
In .zshrc I have :
HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
This seems to be ignored =(
Not sure of the correct term to google, "Terminal output history?"
It's not immediately obvious in the iTerm2 documentation on how to change it.
open the iTerm2 preferences ⌘ + ,
select the Profiles tab
then select the Terminal subtab
Beware, changes to the Scrollback lines value take effect immediately so check Unlimited scrollback now if you don't want to delete your current buffer(s)
change the value of the Scrollback Lines to whatever you'd like
Uncheck the Unlimited scrollback option if you'd like to use your Scrollback lines value
With zsh and iTerm2 Build 3.2.5, an additional step is required: Preferences->Profiles->terminal->check UnlimitedScrollback->Check save lines to scrollback when an app status bar is present
Scrolling was breaking for me without the last one.
It's not a shell problem, it's about your terminal emulator.
You have to find the option in the configuration / options / tools / whatever, for the number of lines to remember.
Apparently you know your terminal emulator is iterm2.
Looking for iterm2 on the google will lead you to the official website, then go to 'Documentation', Ctrl+F 'number' and find
Scrollback lines
The number of lines of scrollback buffer to keep above the visible part of the screen.
This image below helped me to show all the number of lines from console.log().
Please restart the app and you will be able to see the full lines of logs.
Hope this helps!