Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Linux window manager tmux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to use the Linux window manager tmux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Tmux is a tool that allows people to operate multiple sessions through a window. For students who often operate the Linux system, it is definitely a sharp tool to improve work efficiency. We will feel its power and flexibility in a moment.

Install # install the missing package management Homebrew$ ruby-e under Mac OS X "$(curl-fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"# installation artifact Tmux$ brew install tmux Foundation # start Tmux$ tmux# close Tmux$ ctrl + d # or exit $exit

Tmux has three basic concepts: session (Session), Window (window) and Pane (panel). When you type tmux, what tmux actually does is first create a session (Session), and then create a window in this session, you can continue to create multiple windows (Window), each window initially contains only one panel, and after you continue to split the screen, there will be multiple panels (Pane) in which the terminals you see actually belong to a panel of tmux

Further, Session can contain multiple Window, and each Window can contain multiple Pane

Basic operation

How all keyboard shortcuts are executed:

Press the control + b key combination, then release control + b (to tell Tmux I'm going to use the Tmux shortcut), and then press the shortcut key to trigger various behaviors.

For example: Cmurb? The execution process is to press the combination of control + b keys, then release control + b, and then press'?' Key, a list of all shortcuts is displayed.

Cmurb? List all the shortcut keys, press Q or Esc to return to Cmurb d detach current session, you can temporarily return to the Shell interface, enter tmux attach to re-enter the previous session Cmurb s select and switch sessions When multiple sessions are opened at the same time, use the shortcut key Window to operate Cmurb c to create a new window CMub & close the current window CMub w list all window options CMub p switch to previous window CMub n switch to next window CMub window slogan switch window using window slogan (for example, if the window number is 1, then Cmurb 1) CMub, rename the current window Easy to identify each window Pane operation Cmurb% horizontal sub-TerminalC-b "vertical sub-TerminalC-b key will freely select each panel Cmurb x close the current paneC-b Q display panel number Session operation # create a new session$ tmux new-s # create a new Session in the current session And make sure that the previous session still exists # Cmurb: then enter the following command new-s # to enter the session$ tmux attach-t testC-b s named test to list all sessions Cmurb d detach current session (which can be thought of as running in the background) advanced beautification Tmux

Beautify it with gpakosz's Tmux configuration.

Advantages

It is more convenient to use Cmura as the prefix, and save the trigger prefix powerline status bar of Cmurb to beautify (those who have used vim should be familiar with it) to show the battery status of notebook.

Installation and use

$cd$ rm-rf .tmux $git clone https://github.com/gpakosz/.tmux.git$ ln-s. Tmux / .tmux.conf $cp .tmux / .tmux.conf.local. That's all for "how to use the Linux window manager tmux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report