How to have tmux prompt me for the status-left text to display?

孤者浪人 提交于 2021-02-10 04:13:45

问题


I want to change status bar left message to anything I type.
Just like when I press Ctrl+B F I have this prompt in status bar :

(find-window)

I'd like to press, say Ctrl+B E and have a prompt like :

(status-left)

Then on Enter the text I've typed would be assigned to status-left.

I DON'T want to have to call a shell script that would print the prompt in the shell window and print entered value (is that even possible?), I want the prompt to happen in the status bar itself.

How should I go with that? If i put in my .tmux.conf :

unbind e
bin e set status-left

It quite understandably prints Empty value message when I press Ctrl+B E


回答1:


command-prompt is probably what you are looking for.

bind-key S command-prompt -p "New Status: " "set -g status-left '%1'"


来源:https://stackoverflow.com/questions/32033091/how-to-have-tmux-prompt-me-for-the-status-left-text-to-display

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!