-
Notifications
You must be signed in to change notification settings - Fork 5
tmux Notes
π¨ Getting truecolor 24 bit color support working in tmux is a total pain the ass.
β οΈ The tmux server MUST be restarted when adjusting the below settings. Reloading the configuration is not enough!
Add the below lines to the tmux.conf file to get truecolor working. π€
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"Neovim will whine π about the terminal being explicitly set to xterm-256color
screen256-colorhandles italic font a little better within tmux as opposed to usingxterm-256colorbut truecolor support is lost when setting tmuxTERMtoscreen256-colorwithin tmux.
To get italic font working within tmux, click here
The terminal emulator iTerm etc must be able to support italic font.
To add an italic terminfo entry for a particular user
mkdir ~/.terminfoxterm-256color-italic|xterm with 256 colors and italic,
sitm=\E[3m, ritm=\E[23m,
use=xterm-256color,pbpaste > $dots/terms/tmux/xterm-256color-italic.terminfotmux-256color|tmux with 256 colors,
ritm=\E[23m, rmso=\E[27m, sitm=\E[3m, smso=\E[7m, Ms@,
khome=\E[1~, kend=\E[4~,
use=xterm-256color, use=screen-256color,pbpaste > $dots/terms/tmux/tmux-256color.terminfotic -x -o ~/.terminfo $dots/terms/tmux/xterm-256color.terminfo
tic -x -o ~/.terminfo $dots/terms/tmux/tmux-256color.terminfotmux.conf
set -g default-terminal 'tmux-256color'
set -as terminal-overrides ',xterm*:Tc'
And finally for the icing on the π
.vimrc
highlight Comment gui=italic
let &t_8f="\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b="\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
tmux is short for terminal multiplexer
-
By default all tmux key bindings will require a prefix key sequence before they are active. The prefix is initially set as control+b
-
tmux can be used for a paired programming session, ie. two people can login to the same tmux session and edit the same files.
To start a new tmux session with a particular name
tmux new-session -s [session_name]or
tmux new -s [session-name]To create a new tmux session in a detached
tmux new -s [session-name] -dTo list all the tmux commands
tmux list-commandsTo list all the current key-bindings
tmux list-keysTo list available tmux sessions
tmux list-sessionsor
tmux lsTo display a list of sessions known to the local box
<kbd>prefix</kbd> then <kbd>s</kbd>To attach to a tmux session using its name
tmux attach -t [session-name]To kill a tmux session using its name
tmux kill-session -t [session-name]To cycle through various pane layouts in tmux
prefix refers to pressing control + whatever key you have assigned ie. in my situation it would be control + s
prefix then spacebar
To detach from a tmux session
prefix + d
To get a list of all keybindings and associated commands that trigger these bindings prefix + ?
When using the
-rflag in conjunction with thebindkeyword in the.tmux.conffile it allows one to repeat a command without having to repeatedly input the prefix
To get scroll back history when using tmux with iTerm2, see π³
To rename a tmux window prefix+,
To maximize a pane within a tmux window prefix + z
To restore the pane to the previous size prefix + z
- The first user on the system can start a tmux session
tmux new-session -s apples-and-oranges- The second user on the system can connect to the existing session
tmux new-session -t apples-and-oranges -s user2session- Read the following article about using shared clipboard to solve issues with cross system copy / paste.
-
figure out starting a interactive fish shell session within tmux, the$fish_users_pathsare duplicating.
If you find any of this info helpful on your journey π click that π βοΈ star button. It sure makes me feel warm and fuzzy π» on the inside.
-
Linux and macOS Operation Notes
- β macOS Op Notes
- π§ Linux Op Notes
- Vim & Neovim Notes
- git Notes
- π fish shell Notes
- ECMAScript Tooling
- π₯§ Raspberry Pi Notes
- asdf version manager Notes
- Bind9 Notes
- Creating a custom motd on Debian Jessie
- ECMAScript Tooling
- Email client Notes
- Email Server Setup Notes Postfix & Dovecot
- Emoji side quest
- fish shell Notes
- π₯ π€ git it got it good Notes
- git Notes
- Graphics and Image Processing Notes
- GUI text editor Notes
- π»π§ Homebrew and Linuxbrew formula Notes
- Linux and macOS Administration Notes
- Linux and macOS Troubleshooting Notes
- MacBook Pro Late 2013 Notes
- Vim & Neovim Notes
- Video Production Notes
- Python Notes
- radare Notes
- Raspberry Pi Notes
- Terminal Emulators
- Tmux Notes
- Web Browser Notes
- Weechat Notes
- Microsoft Windows Notes