87
77

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

tmux ใง Prefix key ใŒๆŠผใ•ใ‚Œใฆใ„ใ‚‹ใ‹ใฉใ†ใ‹ใ‚’่กจ็คบใ™ใ‚‹

87
Last updated at Posted at 2015-10-07

tmux ใงใƒšใ‚คใƒณๅˆ†ๅ‰ฒใจใ‹ใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆไฝœๆˆใ™ใ‚‹ใจใใจใ‹ใซใ‚ญใƒผใƒใ‚คใƒณใƒ‰ใจใ—ใฆไฝฟใ† Prefix key (C-b ใจใ‹ C-t ใจใ‹่จญๅฎšใ•ใ‚Œใฆใ‚‹) ใงใ™ใŒใ€่ชคๅ‹•ไฝœใ‚’้˜ฒใใŸใ‚ใซใ„ใพ Prefix key ใŒๆŠผใ•ใ‚Œใฆใ„ใ‚‹ใฎใ‹ใฉใ†ใชใฎใ‹่ฆ–่ฆš็š„ใซ็ขบ่ชใ—ใŸใ„ใ“ใจใŒใ‚ใ‚Šใพใ™ใ€‚

ไปฅไธ‹ใฎใ‚ˆใ†ใซ .tmux.conf ใ‚’ๆ›ธใใ“ใจใงใ€Prefix key ใŒๆŠผใ•ใ‚ŒใŸๆ™‚ใซ Status line ใฎ่‰ฒใ‚’ไธ‹ๅ‹•็”ปใฎใ‚ˆใ†ใซๅ่ปขใ•ใ›ใ‚‰ใ‚Œใพใ™ใ€‚

set-option -g status-left '#[fg=cyan,bg=#303030]#{?client_prefix,#[reverse],} #H[#S] #[default]'

prefix-key.gif

(Prefix key ใฏ C-t ใซ่จญๅฎš)

้‡่ฆใชใฎใฏใ“ใ‚Œ

# {?client_prefix,#[reverse],}

.tmux.conf ใงใฏ ?<condition>,<true action>,<false action> ใฎๅฝขใงไธ‰้ …ๆผ”็ฎ—ๅญใ‚’ใ‹ใ‘ใพใ™ใ€‚ใงใ€client_prefix ใฏ Prefix key ใŒๆŠผใ•ใ‚Œใฆใ„ใŸใ‚‰ 1 (true) ใซใชใ‚‹ใจใ„ใ†ใ‚ใ‘ใงใ™ใ€‚
ไปŠๅ›žใฏ่‰ฒใ‚’ๅค‰ใˆใŸใ ใ‘ใงใ™ใŒใ€ๆŠผใ•ใ‚Œใฆใ„ใ‚‹ / ใ„ใชใ„ใจใใ ใ‘ไฝ•ใ‹ใ—ใ‚‰ๆ–‡ๅญ—ใ‚’่กจ็คบใ™ใ‚‹ใ“ใจใ‚‚ใ‚‚ใกใ‚ใ‚“ๅฏ่ƒฝใงใ™ใ€‚

ๆณจๆ„็‚นใŒใ‚ใฃใฆใ€ไพ‹ใˆใฐ Prefix key ใŒๆŠผใ•ใ‚ŒใŸๆ™‚ใ ใ‘้ป„่‰ฒ่ƒŒๆ™ฏ้ป’ๆ–‡ๅญ— (fg=black, bg=yellow) ใซใ—ใ‚ˆใ†ใจใ—ใฆ

# {?client_prefix,#[fg=black,bg=yellow],}

ใจๆ„š็›ดใซๆ›ธใใจ

prefix-key-bug.gif

ใฎใ‚ˆใ†ใซ่กจ็คบใŒใƒใ‚ฐใ‚Šใพใ™ใ€‚#[fg=black,bg=yellow] ๅ†…ใฎใ‚ณใƒณใƒžใŒไธ‰้ …ๆผ”็ฎ—ๅญ2ใคใ‚ใฎใ‚ณใƒณใƒžใจ่งฃ้‡ˆใ•ใ‚Œใฆใ„ใ‚‹ใ‚ˆใ†ใงใ™ใ€‚

ใ“ใ†ใ—ใŸใ„ใจใใฏใ€#[] ใ‚’ๅˆ†ๅ‰ฒใ™ใ‚Œใฐใ‚ˆใ„ใงใ™ใ€‚

# {?client_prefix,#[fg=black]#[bg=yellow],}

prefix-key-great.gif

REF

87
77
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
87
77

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?