Инструменты пользователя

Инструменты сайта


subjects:administration:tmux

Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
subjects:administration:tmux [2023/05/05 23:02]
[Пример конфигурации]
subjects:administration:tmux [2023/05/09 15:36] (текущий)
[Пример конфигурации]
Строка 8: Строка 8:
   * __github.com/​samoshkin/​tmux-config__   * __github.com/​samoshkin/​tmux-config__
   * __github.com/​aleclearmind/​nested-tmux__   * __github.com/​aleclearmind/​nested-tmux__
 +  * __stackoverflow.com/​questions/​35016458/​how-to-write-if-statement-in-tmux-conf-to-set-different-options-for-different-t__
 +  * __stahlke.org/​dan/​tmux-nested__
   * **The Tao of tmux** by //Tony Narlock//:   * **The Tao of tmux** by //Tony Narlock//:
     * __tao-of-tmux.readthedocs.io/​en/​latest__     * __tao-of-tmux.readthedocs.io/​en/​latest__
Строка 37: Строка 39:
 |''​Ctrl+d''​|отключение| |''​Ctrl+d''​|отключение|
  
-==== Choosing sessions, windows and panes ====+==== Закрыть ==== 
 + 
 +  - Войти в режим выбора:​ ''​Ctrl+b''​ ''​w''​ или ''​Ctrl+b''​ ''​s''​. 
 +  - Выбрать стрелочками. 
 +  - Запросить принудительное закрытие:​ ''​Ctrl+b''​ ''​Ctrl+x''​. 
 +  - Согласиться. 
 + 
 +++++ ☛ [EN] sessions, windows, panes and Detaching| 
 + 
 +=== Choosing sessions, windows and panes ===
 There are two key bindings to enter tree mode: There are two key bindings to enter tree mode:
   * ''​Ctrl+b''​ ''​s''​ starts showing only sessions and with the attached session selected;   * ''​Ctrl+b''​ ''​s''​ starts showing only sessions and with the attached session selected;
Строка 67: Строка 78:
  
  
-==== Detaching other clients ​====+=== Detaching other clients ===
 :!: Принудительный разрыв соединений **других** клиентов:​ \\ :!: Принудительный разрыв соединений **других** клиентов:​ \\
 ''​Ctrl+b''​ ''​Shift+d''​ → стрелками выбрать →''​Enter''​. ''​Ctrl+b''​ ''​Shift+d''​ → стрелками выбрать →''​Enter''​.
Строка 82: Строка 93:
  
 Other than using client mode, the ''​detach-client''​ command has a ''​-a''​ flag to detach all clients other than the attached client. Other than using client mode, the ''​detach-client''​ command has a ''​-a''​ flag to detach all clients other than the attached client.
 +
 +
 +++++
  
 ==== Другое ==== ==== Другое ====
Строка 168: Строка 182:
  
 ==== Пример конфигурации ==== ==== Пример конфигурации ====
 +**Нюанс конфигурации** --- префих по-умолчанию стандартный:​ ''​C-b''​ (''​Ctrl+b''​),​ но если определяется,​ что работа идёт через SSH (''​$SSH_CLIENT''​),​ то префикс меняется на ''​C-a''​ (''​Ctrl+a''​),​ также меняется цвет статусбара и справа проступает надпись ''​C-a''​.
 +
 +Проверено на tmux 1.8 и tmux 2.1 .
 +
 <file bash .tmux.conf>​ <file bash .tmux.conf>​
 ###############################################################################​ ###############################################################################​
Строка 173: Строка 191:
 # Reload tmux config # Reload tmux config
 bind r source-file ~/​.tmux.conf bind r source-file ~/​.tmux.conf
 +###############################################################################​
  
 ###############################################################################​ ###############################################################################​
Строка 196: Строка 215:
 # #
 setw -g monitor-activity on setw -g monitor-activity on
- 
 ###############################################################################​ ###############################################################################​
 # If either of the VISUAL or EDITOR environment variables are set to something containing vi (such as vi, vim, nvi) when the tmux server is first started, both of these options are set to vi. # If either of the VISUAL or EDITOR environment variables are set to something containing vi (such as vi, vim, nvi) when the tmux server is first started, both of these options are set to vi.
Строка 204: Строка 222:
 ###############################################################################​ ###############################################################################​
 ## Мышь ## Мышь
-## До версии 2.1+## tmux 1.8
 #set -g mouse-resize-pane on #set -g mouse-resize-pane on
 #set -g mouse-select-pane on #set -g mouse-select-pane on
Строка 242: Строка 260:
 #g display-panes-active-colour display-panes-colour #g display-panes-active-colour display-panes-colour
 #g message-command-style message-style #g message-command-style message-style
 +#set -g status-utf8 on # tmux 1.8
 #g status [on/​off] status-interval [int] status-position [top/​bottom] status-justify [centre] status-style #g status [on/​off] status-interval [int] status-position [top/​bottom] status-justify [centre] status-style
 #g status-left status-left-length [int] status-left-style #g status-left status-left-length [int] status-left-style
Строка 252: Строка 271:
 ## Примечания:​ ## Примечания:​
 # Простые значения "​-g"​ пишутся одним словом без ковычек. # Простые значения "​-g"​ пишутся одним словом без ковычек.
-# У всего, что заканчивается на "​*-style"​ и не только есть возможность его расписать цвета как 3 компонента:​ "​*-fg";​ "​*-bg";​ "​*-attr"​ (dim, bright). Ну или как строку:​ "​fg=[color],​ bg=[color], [attr]"​ +# У всего, что заканчивается на "​*-style"​ и не только есть возможность его расписать цвета как 3 компонента:​ "​*-fg";​ "​*-bg";​ "​*-attr"​ (dim, bright). Ну или как строку:​ "​fg=[color],​ bg=[color], [attr]"​. При этом, опции "​*-style"​ нет в tmux 1.8. 
-# "​*-length"​ означает не строго длинну, а максимальную длинну, int. +# "​*-length"​ означает не строго длину, а максимальную длину, int.
-# Под вопросом:​ +
-#set -g status-utf8 on+
 ###############################################################################​ ###############################################################################​
 ## Пред-установленные значения,​ внутри кавычек,​ перед символ # ## Пред-установленные значения,​ внутри кавычек,​ перед символ #
Строка 270: Строка 287:
 ###############################################################################​ ###############################################################################​
 ## Предустановки:​ ## Предустановки:​
-set -gq @theme-separator "#​[fg=white,​ bright]┇#​[default]"​ 
-###############################################################################​ 
-## Apply @theme-* options to Tmux 
- 
-#g display-panes-active-colour display-panes-colour 
-#g message-command-style message-style 
  
 # Настройки стутусбара # Настройки стутусбара
Строка 283: Строка 294:
 set -g status-position bottom set -g status-position bottom
 set -g status-justify centre set -g status-justify centre
-set -g status-style "bg=default"+set -g status-bg default ​# tmux 1.8-2.1
  
 #~ set -g status-left "#​[bg=yellow,​fg=black]#​S#​[fg=black,​bg=white]#​(tmux ls|wc -l)#​[default] #​[fg=green]#​(whoami)#​[fg=yellow]@#​[fg=green]#​H#​[default]┇#​I:#​P┇"​ #~ set -g status-left "#​[bg=yellow,​fg=black]#​S#​[fg=black,​bg=white]#​(tmux ls|wc -l)#​[default] #​[fg=green]#​(whoami)#​[fg=yellow]@#​[fg=green]#​H#​[default]┇#​I:#​P┇"​
-set -g status-left "#​[fg=yellow,​bg=default]#​S#​[fg=black,​bg=white]#​(tmux ls|wc -l)#​[default] #​[fg=green]#​(whoami)#​[fg=yellow]@#​[fg=green]#​H#​[default]#​{@theme-separator}#I:#P#{@theme-separator}"+#~ set -g status-left "#​[fg=yellow,​bg=default]#​S#​[fg=black,​bg=white]#​(tmux ls|wc -l)#​[default] #​[fg=green]#​(whoami)#​[fg=yellow]@#​[fg=green]#​H#​[fg=white]┇#​I:#​P┇#[default]
 +set -g status-left "#[fg=yellow,​bg=default]#​S#​[fg=black,​bg=white]#​(tmux ls|wc -l)#​[default] #​[fg=green]#​(whoami)#​[fg=yellow]@#​[fg=green]#​H#​[fg=white]┇#I:#P#[default]"
 set -g status-left-length 40 # max-size set -g status-left-length 40 # max-size
-status-left-style+set -g status-left-bg black
  
 #~ set -g status-right "#​[default]┇#​[fg=yellow]#​(cut -d ' ' -f 1-3 /​proc/​loadavg)#​[default] #​[fg=black,​bg=white,​dim]%H:​%M#​[default]"​ #~ set -g status-right "#​[default]┇#​[fg=yellow]#​(cut -d ' ' -f 1-3 /​proc/​loadavg)#​[default] #​[fg=black,​bg=white,​dim]%H:​%M#​[default]"​
-set -g status-right "#{@theme-separator}#​[fg=green]#​(cut -d ' ' -f 1-3 /​proc/​loadavg)#​[default] #​[fg=yellow,​bg=default]%H:​%M#​[default]"​+#~ set -g status-right "#[fg=white]┇#​[fg=green]#​(cut -d ' ' -f 1-3 /​proc/​loadavg)#​[default] #​[fg=yellow,​bg=default]%H:​%M#​[default]"​ 
 +set -g status-right "#​[fg=white]┇#​[fg=default]C-a┇#​[fg=green]#​(cut -d ' ' -f 1-3 /​proc/​loadavg)#​[default] #​[fg=yellow,​bg=black]%H:​%M#​[default]"​
 set -g status-right-length 40 # max-size set -g status-right-length 40 # max-size
-status-right-style+set -g status-right-bg black
  
-#gw clock-mode-colour clock-mode-style [24] +set -gw window-status-activity-fg black # tmux 1.8-2.1 
-#gw mode-style +set -gw window-status-activity-bg white tmux 1.8-2.1 
-#gw pane-active-border-style pane-border-style +set -gw window-status-fg green # tmux 1.8-2.1 
- +set -gw window-status-bg white # tmux 1.8-2.1 
-set -gw window-status-activity-style "​fg=black,​bg=white" +set -gw window-status-current-fg white # tmux 1.8-2.1 
-set -gw window-status-style "fg=green,bg=white" +set -gw window-status-current-bg green # tmux 1.8-2.1 
-set -gw window-status-current-style "​fg=white,​bg=green,​bright"​ +set -gw window-status-current-attr bright ​tmux 1.8-2.1 
-#set -gw window-status-current-format "#I:#W#F" +set -gw window-status-separator ​"┇" 
-#set -gw window-status-format ​"#I:#W#F+###############################################################################​ 
-set -gwF window-status-separator "#​{@theme-separator}"+## local and remote sessions 
 +# if-shell "​shell_command"​ "​true"​ "false
 +if-shell "test -n '​$SSH_CLIENT'"​ \ 
 + "set -g status-bg blue; set -g status-left-bg blue; set -g status-left-attr bright; set -g status-right-bg white; set -g status-right-fg brightred; set -g status-right-attr dim; unbind C-b; set -g prefix C-a; bind C-a send-prefix;​" ​# Ctrl+a for Remote session, Ctrl+b (default) for local
 ###############################################################################​ ###############################################################################​
  
 </​file>​ </​file>​
subjects/administration/tmux.1683316978.txt.gz · Последние изменения: 2023/05/05 23:02 —

На главную страницу Обучение Wikipedia Тестирование Контакты Нашли ошибку? Справка

Записаться на занятия

Ошибка Записаться на занятия к репетитору

Телефоны:

  • +7 (910) 874 73 73
  • +7 (905) 194 91 19
  • +7 (831) 247 47 55

Skype: eduVdom.com

закрыть[X]
Наши контакты