Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Key bindings not working under screen



On Feb 15, 11:55am, Thorsten Kampe wrote:
}
} On systems where JED is not installed (-> DEFAULT_EDITOR=vim) I can 
} observe this:
} 
} % bindkey | wc -l
} 147
} % bindkey | grep copy-prev-shell-word
} "^[-" copy-prev-shell-word
} % screen
} % bindkey | wc -l
} 131
} % bindkey | grep copy-prev-shell-word
} %
} 
} I've renamed my .screenrc but the issue remains. Interestingly it only 
} happens when I set $EDITOR *and* $VISUAL in .zshrc, only under screen 
} and only with zsh (not bash).
} 
} Can someone shed some light about the connection between $EDITOR, 
} $VISUAL, zsh and screen?

Zsh attempts to initialize the ZLE mode based on VISUAL if it is set
and EDITOR if it VISUAL is not.  If whichever of those is chosen looks
like a variant of "vi" then ZLE initializes with vi-style key bindings,
otherwise it initializes with emacs-style key bindings.

Probably what's happening is that when you log in, VISUAL and EDITOR
are not set, and ZLE initializes in emacs mode.  When you then start
screen, those variables are in the environment and ZLE initializes in
vi mode.

I further suspect that some of your bindkey settings are always ending
up in the emacs keymap, even when ZLE is in vi mode.  Have you tried
capturing the bindkey output in a file in each case and diffing them?



Messages sorted by: Reverse Date, Date, Thread, Author