Revisit zsh integration
zsh's antisocial behaviour was fairly promptly fixed (thanks to Stephane Chazelas and his patience). zle-line-init and zle-line-reset seem to be user-defined widgets and the order inverted. Put zle-line-init before reset-prompt because some people do weird things in there.
This commit is contained in:
parent
cf80a15501
commit
b53a3a0981
@ -54,7 +54,7 @@ To start using this navigator, put the following in your '.zshrc':
|
|||||||
|
|
||||||
----
|
----
|
||||||
sdn-navigate () {
|
sdn-navigate () {
|
||||||
# ... possibly zle-line-init
|
# ... possibly zle-line-finish
|
||||||
while eval "`sdn "$BUFFER" "$CURSOR"`"; do
|
while eval "`sdn "$BUFFER" "$CURSOR"`"; do
|
||||||
[ -z "$cd" ] || cd "$cd"
|
[ -z "$cd" ] || cd "$cd"
|
||||||
[ -z "$insert" ] || LBUFFER="$LBUFFER$insert "
|
[ -z "$insert" ] || LBUFFER="$LBUFFER$insert "
|
||||||
@ -66,8 +66,8 @@ sdn-navigate () {
|
|||||||
|
|
||||||
eval "exec </dev/tty; $helper" || break
|
eval "exec </dev/tty; $helper" || break
|
||||||
done
|
done
|
||||||
|
# ... possibly zle-line-init
|
||||||
zle reset-prompt
|
zle reset-prompt
|
||||||
# ... possibly zle-line-finish
|
|
||||||
}
|
}
|
||||||
zle -N sdn-navigate
|
zle -N sdn-navigate
|
||||||
bindkey '\eo' sdn-navigate
|
bindkey '\eo' sdn-navigate
|
||||||
|
3
sdn.cpp
3
sdn.cpp
@ -1654,7 +1654,8 @@ fun save_config () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main (int argc, char *argv[]) {
|
int main (int argc, char *argv[]) {
|
||||||
// That bitch zle closes stdin before exec without redirection
|
// zsh before 5.4 may close stdin before exec without redirection,
|
||||||
|
// since then it redirects stdin to /dev/null
|
||||||
(void) close (STDIN_FILENO);
|
(void) close (STDIN_FILENO);
|
||||||
if (open ("/dev/tty", O_RDWR)) {
|
if (open ("/dev/tty", O_RDWR)) {
|
||||||
cerr << "cannot open tty" << endl;
|
cerr << "cannot open tty" << endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user