zsh-workers
 help / color / mirror / code / Atom feed
* ctrl-u in vim-mode. bug.
@ 2021-11-06  9:33 Taras Halturin
  2021-11-06  9:38 ` Taras Halturin
  2021-11-06 15:04 ` Oliver Kiddle
  0 siblings, 2 replies; 8+ messages in thread
From: Taras Halturin @ 2021-11-06  9:33 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

Hello,

It seems I found a bug in zsh with vim-mode enabled. Ctrl-U (clear line to
the beginning) doesn't work correctly after switching between "normal" and
"insert" modes.
How to reproduce:
1. type a command in zsh
2. press ESC (switches to the "normal mode", which is navigation mode)
3. press 'a' (switches to the insert mode back)
4. try to clean the line with Ctrl-U.

-- 
Best Regards.
Taras Halturin

[-- Attachment #2: Type: text/html, Size: 1366 bytes --]

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

* Re: ctrl-u in vim-mode. bug.
  2021-11-06  9:33 ctrl-u in vim-mode. bug Taras Halturin
@ 2021-11-06  9:38 ` Taras Halturin
  2021-11-06 15:04 ` Oliver Kiddle
  1 sibling, 0 replies; 8+ messages in thread
From: Taras Halturin @ 2021-11-06  9:38 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

Oh, sorry, forgot to write the version of zsh and the environment.

Version: zsh 5.8 (x86_64-pc-linux-gnu)
OS: NixOS 21.11 (Porcupine) x86_64
Kernel: 5.14.14
Terminal: tmux (tmux 3.2a), gnome-terminal (GNOME Terminal 3.42.0 using VTE
0.64.2 +BIDI +GNUTLS +ICU +SYSTEMD)

On Sat, Nov 6, 2021 at 10:33 AM Taras Halturin <halturin@gmail.com> wrote:

> Hello,
>
> It seems I found a bug in zsh with vim-mode enabled. Ctrl-U (clear line to
> the beginning) doesn't work correctly after switching between "normal" and
> "insert" modes.
> How to reproduce:
> 1. type a command in zsh
> 2. press ESC (switches to the "normal mode", which is navigation mode)
> 3. press 'a' (switches to the insert mode back)
> 4. try to clean the line with Ctrl-U.
>
> --
> Best Regards.
> Taras Halturin
>


-- 
Best Regards.
Taras Halturin

[-- Attachment #2: Type: text/html, Size: 2711 bytes --]

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

* Re: ctrl-u in vim-mode. bug.
  2021-11-06  9:33 ctrl-u in vim-mode. bug Taras Halturin
  2021-11-06  9:38 ` Taras Halturin
@ 2021-11-06 15:04 ` Oliver Kiddle
  2021-11-07 21:15   ` Taras Halturin
  1 sibling, 1 reply; 8+ messages in thread
From: Oliver Kiddle @ 2021-11-06 15:04 UTC (permalink / raw)
  To: Taras Halturin; +Cc: zsh-workers

Taras Halturin wrote:
> It seems I found a bug in zsh with vim-mode enabled. Ctrl-U (clear line to the
> beginning) doesn't work correctly after switching between "normal" and "insert"
> modes.

That's not what Ctrl-U does in vi or vim. It deletes from the cursor
back to the point where insert mode was started.

In the zsh documentation for vi-kill-line, exactly that behaviour is
described and that is what you get.

If that's not what you want, you can bind Ctrl-U to kill-whole-line or
kill-buffer or to whatever precise behaviour you want.

Oliver


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

* Re: ctrl-u in vim-mode. bug.
  2021-11-06 15:04 ` Oliver Kiddle
@ 2021-11-07 21:15   ` Taras Halturin
  2021-11-07 21:33     ` Lawrence Velázquez
  0 siblings, 1 reply; 8+ messages in thread
From: Taras Halturin @ 2021-11-07 21:15 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]

Hello Oliver,

Thanks for the reply. Just to make sure if we understand each other.

in vim
1. press I for insert mode
2. type "asdf"
3. ESC for normal mode
4. press "shift-a" for append
5. press "ctrl-u" <- clears the line till the beginning

in zsh with vi-mode
1. (its in insert mode by default)
2. type "asdf"
3. ESC for normal mode
4. press "shift-a" for append
5. press "ctrl-u" <- nothing happens.

I thought its a bug. But if it is intended behavior, let it be this way.

On Sat, Nov 6, 2021 at 4:04 PM Oliver Kiddle <opk@zsh.org> wrote:

> Taras Halturin wrote:
> > It seems I found a bug in zsh with vim-mode enabled. Ctrl-U (clear line
> to the
> > beginning) doesn't work correctly after switching between "normal" and
> "insert"
> > modes.
>
> That's not what Ctrl-U does in vi or vim. It deletes from the cursor
> back to the point where insert mode was started.
>
> In the zsh documentation for vi-kill-line, exactly that behaviour is
> described and that is what you get.
>
> If that's not what you want, you can bind Ctrl-U to kill-whole-line or
> kill-buffer or to whatever precise behaviour you want.
>
> Oliver
>


-- 
Best Regards.
Taras Halturin

[-- Attachment #2: Type: text/html, Size: 3546 bytes --]

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

* Re: ctrl-u in vim-mode. bug.
  2021-11-07 21:15   ` Taras Halturin
@ 2021-11-07 21:33     ` Lawrence Velázquez
  2021-11-07 21:38       ` Taras Halturin
  0 siblings, 1 reply; 8+ messages in thread
From: Lawrence Velázquez @ 2021-11-07 21:33 UTC (permalink / raw)
  To: Taras Halturin, Oliver Kiddle; +Cc: zsh-workers

On Sun, Nov 7, 2021, at 4:15 PM, Taras Halturin wrote:
> Thanks for the reply. Just to make sure if we understand each other.
>
> in vim
> 1. press I for insert mode
> 2. type "asdf"
> 3. ESC for normal mode
> 4. press "shift-a" for append
> 5. press "ctrl-u" <- clears the line till the beginning

That is not the default behavior.

https://vimhelp.org/insert.txt.html#i_CTRL-U

    CTRL-U  Delete all entered characters before the cursor in the
            current line.  If there are no newly entered characters and
            'backspace' is not empty, delete all characters before the
            cursor in the current line.  See `i_backspacing` about
            joining lines.

Do you have the "backspace" option set?

(If possible, it's good practice to suppress custom settings before
reporting "bugs".  [Unless you're discussing a nondefault setting,
of course.]  Try your steps in `vim -u NONE`.)

-- 
vq


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

* Re: ctrl-u in vim-mode. bug.
  2021-11-07 21:33     ` Lawrence Velázquez
@ 2021-11-07 21:38       ` Taras Halturin
  2021-11-07 21:49         ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Taras Halturin @ 2021-11-07 21:38 UTC (permalink / raw)
  To: Lawrence Velázquez; +Cc: Oliver Kiddle, zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]

I've just tested with vim -u NONE and it behaves the same way as written
before (on step 5) - it clears the line to the beginning

On Sun, Nov 7, 2021 at 10:34 PM Lawrence Velázquez <larryv@zsh.org> wrote:

> On Sun, Nov 7, 2021, at 4:15 PM, Taras Halturin wrote:
> > Thanks for the reply. Just to make sure if we understand each other.
> >
> > in vim
> > 1. press I for insert mode
> > 2. type "asdf"
> > 3. ESC for normal mode
> > 4. press "shift-a" for append
> > 5. press "ctrl-u" <- clears the line till the beginning
>
> That is not the default behavior.
>
> https://vimhelp.org/insert.txt.html#i_CTRL-U
>
>     CTRL-U  Delete all entered characters before the cursor in the
>             current line.  If there are no newly entered characters and
>             'backspace' is not empty, delete all characters before the
>             cursor in the current line.  See `i_backspacing` about
>             joining lines.
>
> Do you have the "backspace" option set?
>
> (If possible, it's good practice to suppress custom settings before
> reporting "bugs".  [Unless you're discussing a nondefault setting,
> of course.]  Try your steps in `vim -u NONE`.)
>
> --
> vq
>


-- 
Best Regards.
Taras Halturin

[-- Attachment #2: Type: text/html, Size: 2020 bytes --]

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

* Re: ctrl-u in vim-mode. bug.
  2021-11-07 21:38       ` Taras Halturin
@ 2021-11-07 21:49         ` Bart Schaefer
  2021-11-07 21:56           ` Taras Halturin
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2021-11-07 21:49 UTC (permalink / raw)
  To: Taras Halturin; +Cc: Lawrence Velázquez, Oliver Kiddle, Zsh hackers list

On Sun, Nov 7, 2021 at 1:46 PM Taras Halturin <halturin@gmail.com> wrote:
>
> I've just tested with vim -u NONE and it behaves the same way as written before (on step 5) - it clears the line to the beginning

What version number of vim do you have?  I tested with version
8.1.2269 and it behaves as Oliver and Lawrence have described.  The
online help text that Lawrence quoted is for version 8.2.


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

* Re: ctrl-u in vim-mode. bug.
  2021-11-07 21:49         ` Bart Schaefer
@ 2021-11-07 21:56           ` Taras Halturin
  0 siblings, 0 replies; 8+ messages in thread
From: Taras Halturin @ 2021-11-07 21:56 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Lawrence Velázquez, Oliver Kiddle, Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

Oh, thats the difference - just realized I use neovim (0.5.1). Seems it
behaves a bit differently. Thanks for your answers.

On Sun, Nov 7, 2021 at 10:49 PM Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Sun, Nov 7, 2021 at 1:46 PM Taras Halturin <halturin@gmail.com> wrote:
> >
> > I've just tested with vim -u NONE and it behaves the same way as written
> before (on step 5) - it clears the line to the beginning
>
> What version number of vim do you have?  I tested with version
> 8.1.2269 and it behaves as Oliver and Lawrence have described.  The
> online help text that Lawrence quoted is for version 8.2.
>


-- 
Best Regards.
Taras Halturin

[-- Attachment #2: Type: text/html, Size: 1261 bytes --]

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

end of thread, other threads:[~2021-11-07 21:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06  9:33 ctrl-u in vim-mode. bug Taras Halturin
2021-11-06  9:38 ` Taras Halturin
2021-11-06 15:04 ` Oliver Kiddle
2021-11-07 21:15   ` Taras Halturin
2021-11-07 21:33     ` Lawrence Velázquez
2021-11-07 21:38       ` Taras Halturin
2021-11-07 21:49         ` Bart Schaefer
2021-11-07 21:56           ` Taras Halturin

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).