projects
/
grml-etc-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
aad6e4e
)
zsh: complete from screen and tmux, workaround screen
author
Bernhard Tittelbach
<bernhard@tittelbach.org>
Fri, 22 Jul 2011 20:03:36 +0000
(22:03 +0200)
committer
Michael Prokop
<mika@grml.org>
Sun, 24 Jul 2011 13:27:04 +0000
(15:27 +0200)
etc/zsh/zshrc
patch
|
blob
|
history
diff --git
a/etc/zsh/zshrc
b/etc/zsh/zshrc
index
cf20ca7
..
a92ffb5
100644
(file)
--- a/
etc/zsh/zshrc
+++ b/
etc/zsh/zshrc
@@
-1017,8
+1017,8
@@
zstyle ':completion:hist-complete:*' completer _history
#k# complete word from history with menu
bindkey "^X^X" hist-complete
#k# complete word from history with menu
bindkey "^X^X" hist-complete
-## complete word from currently visible S
CREEN
buffer.
-if check_com -c screen ; then
+## complete word from currently visible S
creen or Tmux
buffer.
+if check_com -c screen
|| check_com -c tmux
; then
_complete_screen_display() {
[[ "$TERM" != "screen" ]] && return 1
_complete_screen_display() {
[[ "$TERM" != "screen" ]] && return 1
@@
-1026,8
+1026,15
@@
if check_com -c screen ; then
local -U -a _screen_display_wordlist
trap "rm -f $TMPFILE" EXIT
local -U -a _screen_display_wordlist
trap "rm -f $TMPFILE" EXIT
- screen -X hardcopy $TMPFILE
# fill array with contents from screen hardcopy
# fill array with contents from screen hardcopy
+ if ((${+TMUX})); then
+ #works, but crashes tmux below version 1.4
+ tmux -q capture-pane \; save-buffer -b 0 $TMPFILE \; delete-buffer -b 0
+ else
+ screen -X hardcopy $TMPFILE
+ #screen sucks, it dumps in latin1, apparently always. so recode it to system charset
+ check_com recode && recode latin1 $TMPFILE
+ fi
_screen_display_wordlist=( ${(QQ)$(<$TMPFILE)} )
# remove PREFIX to be completed from that array
_screen_display_wordlist[${_screen_display_wordlist[(i)$PREFIX]}]=""
_screen_display_wordlist=( ${(QQ)$(<$TMPFILE)} )
# remove PREFIX to be completed from that array
_screen_display_wordlist[${_screen_display_wordlist[(i)$PREFIX]}]=""