1
1

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.

[tiny fix] zsh + tmux で端末に表示されてる文字列を補完する

Last updated at Posted at 2017-02-04

背景

tmuxのバージョンを2.3に上げたところ、うまく動かなくなったので少々修正しました。

内容

HARDCOPYFILE=/tmp/tmux-hardcopy
touch $HARDCOPYFILE
dabbrev-complete () {
  tmux capture-pane -b 0 && tmux save-buffer -b 0 $HARDCOPYFILE && tmux delete-buffer -b 0
  local reply=($(sed '/^$/d' $HARDCOPYFILE | sed '$ d'))
  compadd -Q - "${reply[@]%[*/=@|]}"
}
zle -C dabbrev-complete menu-complete dabbrev-complete
bindkey '^O' dabbrev-complete
bindkey '^O^_' reverse-menu-complete

zsh + tmux で端末に表示されてる文字列を補完する を元に tmux capture-pane 時にバッファ指定をするように修正しました。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?