Difference between revisions of "Tmux"

From wikieduonline
Jump to navigation Jump to search
 
(28 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
[[wikipedia:tmux|tmux]]<ref>http://man7.org/linux/man-pages/man1/tmux.1.html</ref> is a [[terminal multiplexer]] first released in 2007.
+
<code>[[wikipedia:tmux|tmux]]</code> is a [[terminal multiplexer]] first released in 2007.
 +
* http://man7.org/linux/man-pages/man1/tmux.1.html
  
===Basic command usage===
+
== Installation ==
* <code>tmux ls</code><ref>https://gist.github.com/MohamedAlaa/2961058</ref>  
+
* macOS: <code>[[brew install tmux]]</code>
* Config file: <code>$HOME/[[.tmux.conf]]</code>
+
* Linux: <code>[[apt install tmux]]</code>
 +
 
 +
== Examples ==
 +
* <code>[[tmux ls]]</code><ref>https://gist.github.com/MohamedAlaa/2961058</ref>  
 +
* Config file: <code>$[[HOME]]/[[.tmux.conf]]</code>
 
* <code>[[tmux -f]] your_tmux_config_file.conf</code>
 
* <code>[[tmux -f]] your_tmux_config_file.conf</code>
* <code>[[tmux new -s]] my_session_name</code>
+
* New session: <code>[[tmux new -s]] my_session_name</code>
 +
**  [[CTRL+b]], C
 
* <code>tmux a</code> or <code>tmux attach</code> Attach to last used session.<ref>https://medium.com/actualize-network/a-minimalist-guide-to-tmux-13675fb160fa</ref>
 
* <code>tmux a</code> or <code>tmux attach</code> Attach to last used session.<ref>https://medium.com/actualize-network/a-minimalist-guide-to-tmux-13675fb160fa</ref>
 
* <code>[[tmux attach -t]] my_session_name</code> or <code>tmux attach-session -t my_session_name</code>
 
* <code>[[tmux attach -t]] my_session_name</code> or <code>tmux attach-session -t my_session_name</code>
* <code>tmux attach -t 0</code> or <code>tmux attach-session -t 0</code>
+
* <code>[[tmux attach -t 0]]</code> or <code>tmux attach-session -t 0</code>
 
* <code>[[tmux kill-server]]</code>
 
* <code>[[tmux kill-server]]</code>
* [[Detach]]: <code>[[Ctrl+b]] d</code>
+
* [[Detach]]: <code>[[CTRL+b]] d</code>
 
+
* <code>[[tmux new]]</code> or <code>[[tmux new-session]]</code>
===Examples===
+
* [[tmux list-keys]]
Example shows two running sessions: 0 and my_named_session:
+
* [[Split screen]]: <code>[[Ctrl b]] + %</code>
<pre>
+
* [[Move between panes]]: <code>Ctrl+b Arrow Key (Left, Right, Up, Down)</code>
tmux ls
 
0: 1 windows (created Sat Sep 15 09:38:43 2018) [158x35]
 
my_named_session: 1 windows (created Sat Sep 15 10:13:11 2018) [78x35]
 
</pre>
 
  
 
== Activities ==
 
== Activities ==
Line 27: Line 29:
  
 
== Related terms ==
 
== Related terms ==
* [[ncurses]]
+
* <code>[[ncurses]]</code>
* [[Tlog]]
+
* <code>[[tlog]]</code>
 +
* <code>[[tmux-cssh]]</code>
 +
* [[i3 (window manager)]]
 +
* [[OpenBSD]] https://man.openbsd.org/tmux.1
 +
* [[Byobu]]
  
 
== See also ==
 
== See also ==
 
* {{tmux}}
 
* {{tmux}}
* [[reptyr]]<ref>https://linux.die.net/man/1/reptyr</ref> Reparent a running program to a new terminal
+
* {{terminal}}
 
* <code>[[kitty]]</code> and <code>[[alacritty]]</code> GPU terminal emulators
 
* <code>[[kitty]]</code> and <code>[[alacritty]]</code> GPU terminal emulators
 
* [[iTerm2]] (macOS). Install iTerm2 <code>brew cask install iterm2</code> and use <code>CMD+D</code> to [[split screen]] vertically.
 
* [[iTerm2]] (macOS). Install iTerm2 <code>brew cask install iterm2</code> and use <code>CMD+D</code> to [[split screen]] vertically.
 
* <code>[[last]]</code>: <code>root    pts/1        tmux(41272).%0  Thu Dec 11 12:02    gone - no logout</code>
 
* <code>[[last]]</code>: <code>root    pts/1        tmux(41272).%0  Thu Dec 11 12:02    gone - no logout</code>
  
[[Category:Software]]
+
[[Category:Tmux]]

Latest revision as of 08:53, 28 February 2024

tmux is a terminal multiplexer first released in 2007.

Installation[edit]

Examples[edit]

Activities[edit]

  1. Open a tmux session, disconnect your computer and reconnect again to your previous session using tmux attach or tmux a
  2. Transfer current command to a detachable session (reptyr): https://superuser.com/questions/623432/transfer-current-command-to-a-detachable-session-tmux-screen
  3. Add set -g mouse on to your $HOME/.tmux.conf file to scroll using your mouse.[3] (tmux kill-server)

Related terms[edit]

See also[edit]

  • https://gist.github.com/MohamedAlaa/2961058
  • https://medium.com/actualize-network/a-minimalist-guide-to-tmux-13675fb160fa
  • https://superuser.com/a/510310
  • Advertising: