Summary
.zshrc に以下を記述.(2nd lifeより)Ctrl + o で端末上の文字列を補完可能.
# dabbrev
HARDCOPYFILE=$HOME/tmp/screen-hardcopy
touch $HARDCOPYFILE
dabbrev-complete () {
local reply lines=80 # 80行分
screen -X eval "hardcopy -h $HARDCOPYFILE"
reply=($(sed '/^$/d' $HARDCOPYFILE | sed '$ d' | tail -$lines))
compadd - "${reply[@]%[*/=@|]}"
}
zle -C dabbrev-complete menu-complete dabbrev-complete
bindkey '^o' dabbrev-complete
bindkey '^o^_' reverse-menu-complete
Reference
2nd life - zsh + screen で端末に表示されてる文字列を補完するhttp://d.hatena.ne.jp/secondlife/20060108/1136650653