什么是 tmux 的“消息命令”?

iva*_*van 7 tmux

我一直在尝试弄清楚如何在 tmux 的复制模式下更改命令提示符的背景颜色。它默认为黑色橙色,至少在我的设置中是这样。

我用这些行更改了状态行中的命令提示符的颜色 .tmux.conf

set -g message-bg '#e7e7e7'
set -g message-fg '#000000'
Run Code Online (Sandbox Code Playgroud)

但这对显示在状态行上方的提示没有影响,例如,当我运行list-keys并点击/搜索时。该Search Down:提示是黑色橙色。

我希望我可以set -g message-command-bg '#e7e7e7'不用骰子来改变它,事实上,我根本不知道有什么message-command-style变化。手册说它改变了“状态行消息命令”的风格,但我不知道那会是什么,如果不是我用message-bg.

有什么帮助吗?

根据要求:我的.tmux.conf

# This seems to have no effect at all
set -g message-command-style bg=red
# nor does this
set -g message-command-bg red

# use UTF8
set -g utf8
set-window-option -g utf8 on

# 256 colors
set -g default-terminal "screen-256color"

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

# scrollback history
set -g history-limit 3000

# act like GNU screen
unbind C-b
set -g prefix C-a
bind C-a send-prefix

# indifferent bindings
bind C-n next-window
bind C-p previous-window
bind C-l last-window

# kills
bind-key k kill-pane
unbind &
bind-key K confirm-before -p "kill-window #W? (y/n)" kill-window
unbind x
bind-key x confirm-before -p "kill-session #S? (y/n)" kill-session

# shorten command delay
set -sg escape-time 1

# set pane color
set-option -g pane-border-fg colour240
set-option -g pane-active-border-fg colour240

# status bar
set -g status-utf8 on
set -g status-bg '#e7e7e7'
set -g status-fg '#404040'
set -g status-attr bright
set-window-option -g window-status-format ' #I #W'
set-window-option -g window-status-current-format ' #I #W'
set-window-option -g window-status-current-fg '#1922bd'
set-window-option -g window-status-current-attr bright
set -g message-bg '#e7e7e7'
set -g message-fg '#000000'

set -g status-justify left
set -g status-right-length 50
set -g status-right ' (#S) :: #h :: #(sysctl vm.loadavg | cut -d " " -f 3-5) '
set -g status-left ''
Run Code Online (Sandbox Code Playgroud)

Tho*_*key 5

了解 tmux 的版本可能会有所帮助。不考虑包装商的本地定制,

  • tmux 1.8 根本没有这样做。
  • tmux 1.9a 添加了三个使用黑色/黄色的可配置设置,
  • 仍在 tmux 2.1 中(删除了一些功能)。

要查看详细信息,请阅读options-table.c

  • message-command-style (黄底黑字)
  • message-style (黄底黑字)
  • mode-style (黄底黑字)

你问的是一个是第二,message-style,该手册页介绍

message-style style
设置状态行消息样式。关于如何指定样式,请参见message-command-style选项。

一些其他设置修改此样式的部分:message-attr,message-bgmessage-fg


jas*_*yan 1

状态行消息命令是输入前缀加时出现的提示:

设置这些颜色不会搜索提示的颜色产生任何影响(默认情况下,搜索提示的颜色是相当花哨的黄底黑字,并且不可配置,AFAIAA)。