zsh-users
 help / color / mirror / code / Atom feed
* Recently changed behavior with moving between CTRL-R history search to vi mode
@ 2016-06-15 22:59 Cory Klein
  2016-06-16 20:18 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Cory Klein @ 2016-06-15 22:59 UTC (permalink / raw)
  To: zsh-users

Use case: Modify and run a previously run command.

Solution:

1. CTRL-R
2. search for command
3. ESC to end history search, placing result into command prompt
4. ESC again to enter vi mode
5. w/l/other vi movement key

However, recently I'm seeing that in some cases my shell is combining
the ESC from 4 with the movement key from 5:

ESC-w => delete from the beginning of the line to the current cursor position
ESC-l => insert "ls" in the current cursor position and execute the
command immediately (huh?)

I can get the original behavior back by hitting ESC one more time -
escaping whatever strange mode my prompt is in, and getting into vi
mode for reals.

Forgive me if this is not the correct forum for seeking help with
this, but does anyone here know what might be happening here, have a
solution, or a suggestion on where else I may look for more
information?

Thanks,

Cory Klein


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Recently changed behavior with moving between CTRL-R history search to vi mode
  2016-06-15 22:59 Recently changed behavior with moving between CTRL-R history search to vi mode Cory Klein
@ 2016-06-16 20:18 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2016-06-16 20:18 UTC (permalink / raw)
  To: zsh-users

On Jun 15,  4:59pm, Cory Klein wrote:
}
} 1. CTRL-R
} 2. search for command
} 3. ESC to end history search, placing result into command prompt
} 4. ESC again to enter vi mode
} 5. w/l/other vi movement key
} 
} However, recently I'm seeing that in some cases my shell is combining
} the ESC from 4 with the movement key from 5

This is the right place to ask, but I'm not able to reproduce a problem.
This bit --

} ESC-l => insert "ls" in the current cursor position and execute the
} command immediately (huh?)

-- makes me believe that some other bindings are getting involved.

Try this:

    PS1="%v |$PS1"
    zle-keymap-select() { psvar=("$1 -> $KEYMAP"); zle reset-prompt }
    zle -N zle-keymap-select

This should cause your prompt to look like e.g.

main -> vicmd |torch% 

after you hit the first ESC.  If that's not what it looks like, that is
if it says something other than "vicmd" to the right of the ->, then
whatever it does say will be a clue.

(If you're already using psvar / %v for some other prompt configuration,
there are other ways to display the same information.)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-16 20:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15 22:59 Recently changed behavior with moving between CTRL-R history search to vi mode Cory Klein
2016-06-16 20:18 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).