IT TIP

tmux 상태 표시 줄 구성

itqueen 2020. 12. 11. 21:09
반응형

tmux 상태 표시 줄 구성


상태 표시 줄은 어떻게 사용자 지정됩니까? 나는 눈치 이 YouTube 동영상 (3시 5분에서 - 아래 이미지), 내 맥 OS X에서 TMUX를 설치 한 후 참조하는 기본보다 매우 다른 상태 표시 줄 모양

특히 상태 표시 줄 중앙에 현재 프로그램이 표시되고 왼쪽에 현재 세션 이름 만 표시되는 방식이 마음에 듭니다. 이에 비해 내 설정은 모든 세션의 이름을 표시하고 현재 응용 프로그램을 표시하지 않습니다 (현재 포커스 된 창에 대해).

누구든지이 작업을 수행 할 수있는 샘플 구성을 보여 주거나 사용자 지정 규칙을 찾을 수있는 위치를 보여줄 수 있다면 좋을 것입니다! 감사!

여기에 이미지 설명 입력

업데이트 : 궁금한 사람이 있으시면 영상에서 본 것과 유사한 상태 표시 줄을 사용자 정의 할 수 있었으며 (사소한 조정) 예제를보고 싶다면 제 github에서 제 구성 파일 찾을 수 있습니다 .


man페이지에는 모든 다양한 옵션에 대한 매우 자세한 설명이 있습니다 (상태 표시 줄은 고도로 구성 가능). 가장 좋은 방법은로 man tmux시작하는 옵션 을 읽고 특별히주의를 기울이는 것입니다 status-.

예를 들어, status-bg red바의 배경색을 설정합니다.

The three components of the bar, the left and right sections and the window-list in the middle, can all be configured to suit your preferences. status-left and status-right, in addition to having their own variables (like #S to list the session name) can also call custom scripts to display, for example, system information like load average or battery time.

The option to rename windows or panes based on what is currently running in them is automatic-rename. You can set, or disable it globally with:

setw -g automatic-rename [on | off]

The most straightforward way to become comfortable with building your own status bar is to start with a vanilla one and then add changes incrementally, reloading the config as you go.1

You might also want to have a look around on github or bitbucket for other people's conf files to provide some inspiration. You can see mine here2.



1 You can automate this by including this line in your .tmux.conf:

bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."

You can then test your new functionality with Ctrlb,Shiftr. tmux will print a helpful error message—including a line number of the offending snippet—if you misconfigure an option.

2 Note: I call a different status bar depending on whether I am in X or the console - I find this quite useful.


I used tmux-powerline to fully pimp my tmux status bar. I was googling for a way to change to background of the status bar when your typing a tmux command. When I stumbled on this post I thought I should mention it for completeness.

Update: This project is in a maintenance mode and no future functionality is likely to be added. tmux-powerline, with all other powerline projects, is replaced by the new unifying powerline. However this project is still functional and can serve as a lightweight alternative for non-python users.


I have been playing about with tmux today, trying to customised a little here and there, managed to get battery info displaying on the status right with a ruby script.

Copy the ruby script from http://natedickson.com/blog/2013/04/30/battery-status-in-tmux/ and save it as:

 battinfo.rb in ~/bin

To make it executable make sure to run:

chmod +x ~/bin/battinfo.rb

edit your ~/.tmux.config and include this line

set -g status-right "#[fg=colour155]#(pmset -g batt | ~/bin/battinfo.rb) | #[fg=colour45]%d %b %R"

Do C-b, :show which will show you all your current settings. /green, nnn will find you which properties have been set to green, the default. Do C-b, :set window-status-bg cyan and the bottom bar should change colour.

List available colours for tmux

You can tell more easily by the titles and the colours as they're actually set in your live session :show, than by searching through the man page, in my opinion. It is a very well-written man page when you have the time though.

변경 사항 중 하나가 마음에 들지 않고 원래 설정 방법을 기억할 수없는 경우 새 tmux 세션을 열 수 있습니다. 좋은 편집 ~/.tmux.conf위해 설정을 변경하려면 set window-status-bg -g cyan. 여기 내 것 : https://gist.github.com/9083598

참고 URL : https://stackoverflow.com/questions/9628435/tmux-status-bar-configuration

반응형