package defaults are unfriendly for users that use the 'viins' editing mode

Bug #72054 reported by Ward
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zsh (Debian)
Fix Released
Unknown
zsh (Ubuntu)
Incomplete
Wishlist
Unassigned

Bug Description

Binary package hint: zsh

If you select the 'viins' keymap in zsh the keybindings are very strange. Up arrow puts the cursor at the beginning of the line, instread of the end and lots of other little things. The cause of this is all the strangeness in /etc/zsh/zshrc. In fact non of the contents are needed, and if they're not there zsh behaves as it does by default.

I really think shell customization should be up to the user and not the packager of the shell. If shells do get configured in the packageing process, the user gets put in a position where he/she has to hunt down every little odd thing which makes a shell behave just this much different on another machine and compensate for everything in his/her dotfiles. The only exception I can think of is the PATH setting, that may be a valid thing to configure system wide.

So the fix here is:

cat /dev/null > /etc/zsh/zshrc

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Have you tried with a more recent version of Ubuntu? Gutsy has zsh-4.3.4, and it could be fixed there.

Changed in zsh:
assignee: nobody → tepsipakki
status: New → Incomplete
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

No reply, closing.

Changed in zsh:
assignee: tepsipakki → nobody
status: Incomplete → Invalid
Revision history for this message
Ward (ward-wouts) wrote :

It's not fixed.
It's actually very easy to test:

$ zsh -l
% bindkey -v
<press arrow up>
If the cursor is at the beginning of the line, it's not fixed.

Alternitavely:
ls -l /etc/zsh
If the filesizes are non-zero, it's not fixed.

Ward (ward-wouts)
Changed in zsh:
status: Invalid → New
Revision history for this message
Reinhard Tartler (siretart) wrote :

So this bugtitle should probably rephrased to "Please don't override upstream's defaults"?

in that case, I'm pretty much inclined to reject this bug. We do change some defaults on purpose.

Changed in zsh:
status: New → Incomplete
Revision history for this message
Ward (ward-wouts) wrote :

Changes like PATH and MANPATH settings in a shell to make it fit with an installation, I can understand, they can serve a purpose. Adding completions to fit a system, I can understand, they can serve a purpose. But these key rebinding changes make viins-mode in zsh hardly usable, they are /very/ invasive. I really do not understand the purpose behind modifying shell behavior in such a manner that people who know that shell from any other systems will find it unusable. These changes in viins-mode behavior are very easy to remove and will make zsh in viins-mode (which not a lot of people use, I think) much more usable. Talking about this is taking more time that just fixing the problem would. :(

Revision history for this message
Reinhard Tartler (siretart) wrote :

I'm not really sure what viins-mode is (it does not appear in zshall(1) after all) and googling for it gave be ~10 hits, among others this bug. I therefore conclude that it is not a very common configuration.

Anyway, if you could propose a concerete patch to the zsh package, I'd be happy to discuss it with you. If you are proposing to drop all files in /etc/zsh/*, then I'm sorry to say that I don't consider that acceptable. You are free to do that on systems that you maintain, but I object to do that in the official ubuntu package.

Revision history for this message
Ward (ward-wouts) wrote :

Look for 'viins' in zshall(1), it's there.

Here are two patches 'zshrc-bindkey-viins.diff' only removes the key rebindings in viins mode and fixes my usability problem nicely. 'zshrc-bindkey-all.diff' is more ambitious and removes all key rebindings. I have not tested emacs mode, as I don't use it (so I don't know what normal behaviour in emacs mode would be).

Revision history for this message
Ward (ward-wouts) wrote :

And the more ambitious patch... this would solve similar problems (if they exist) in emacs mode and vicmd mode as well. But as I don't use those modes I don't know if this is necessary.

Revision history for this message
Reinhard Tartler (siretart) wrote : Re: [Bug 72054] Re: very non-default zsh behaviour

> Look for 'viins' in zshall(1), it's there.

not as in version 4.3.4-24ubuntu1 of the zsh package in ubuntu. But
after some more digging, I found that in zshzle(1), which is not
included in zshall(1).

After a bit scimming the manpage, it seems that this bug should better
be reworded with: "package defaults are unfriendly for users that use
the 'viins' editing mode". Does this fit?

In any case, I think this needs discussion on ubuntu-devel.

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

Revision history for this message
Martin von Wittich (martin.von.wittich) wrote : Re: very non-default zsh behaviour

It's a bit offtopic, but: is it possible that the zshall manpage in current Ubuntu is broken? Look at this:

martin@samson ~ % man -P cat zshall|wc -l
zsoelim: can't open man1/zshroadmap.1: No such file or directory
361
martin@samson ~ % man -P cat zshall|wc -l
zsoelim: can't open man1/zshmisc.1: No such file or directory
521

(error messages differ from invocation to invocation)

On debian stable:

iserv:~# man -P cat zshall|wc -l
Reformatting zshall(1), please wait...
20664

Revision history for this message
Reinhard Tartler (siretart) wrote : Re: [Bug 72054] Re: very non-default zsh behaviour

Martin von Wittich <email address hidden> writes:

> It's a bit offtopic, but: is it possible that the zshall manpage in
> current Ubuntu is broken? Look at this:

Yes, pretty much possible. Please file a seperate bug about this.

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

setting status to confirmed...
where are we on this issue? has anyone looked at the patches proposed by ward? have they been introduced?

Changed in zsh:
status: Incomplete → New
status: New → Confirmed
Revision history for this message
Joke de Buhr (joke) wrote :

The zsh manual says the viins mode is automatically turned on if the EDITOR environment variable contains anything linke 'vi'.
http://zsh.sourceforge.net/Doc/Release/zsh_17.html#SEC92

The additional ubuntu keybindings cause a lot of trouble if someone exports EDITOR=vim in .zshrc and starts an other zsh instance via sudo -s oder screen. The new instance starts with viins mode and the keybindings in /etc/zsh/zshrc are activated.

This doesn't affect a normal login shells since the environment most likely doesn't have the EDITOR variable set.

Revision history for this message
No (11111nonononono-deactivatedaccount-deactivatedaccount-deactivatedaccount) wrote :

I tried this in Karmic and most keys worked as expected.
Anybody else tried this in Karmic?

Changed in zsh (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Ward (ward-wouts) wrote :

I just tried in Karmic and the problem is still there. It's irrelevant that most keys work as expected, they should all work as expected. This whole situation leaves me wondering why it's taking over 2 years to fix something as trivial as this.

To reproduce:

$ sudo apt-get install zsh
$ zsh
(choose 'q' to do nothing)
% bindkey -v
press arrow up. You'll see:

% bindkey -v

with the cursor on the 'b' instead of at the end of the line.

As you can see, actually testing this takes 2 minutes at most. The fix is still to just get rid of all the 'bindkey -M viins' lines in /etc/zsh/zshrc. Which is exactly what the patch that I sent in a year and a half ago would accomplish. Seeing how long something as simple as this is taking, I don't have much faith left in the ubuntu bug handling process...

Revision history for this message
No (11111nonononono-deactivatedaccount-deactivatedaccount-deactivatedaccount) wrote :

Removing all keybindings as you suggested in your second patch is not an option, as this would make some keys, e.g. Home and Delete, unusable (zsh doesn't recognize them correctly by default).
Removing the other keybindings may cause problems, because I don't know how zsh determines which sequence the key sends (here this is done via the terminfo database).
So I would suggest to change the keybindings that are annoying and differ from what you would expect (e.g. k in vicmd mode is bound to up-line-or-history and arrow up in viins mode is bound to vi-up-line-or-history).
The line
[[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" vi-up-line-or-history
should be replaced with:
[[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" up-line-or-history
and similar for the other Arrow keys.

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

Still the case in karmic

It's easy to check if this is still there by looking at the .diff.gz file in packages.ubuntu.com

Changed in zsh (Ubuntu):
importance: Undecided → Wishlist
status: Incomplete → Confirmed
Changed in zsh (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
wfaulk (wfaulk) wrote :

Any reason that this still hasn't been fixed? The override mappings are insane. They seem to come directly from Debian (where there's also a bug on it <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=383737>).

No one seems to know how they got there in the first place.

I think it's ridiculous for the package to override the packaged software's default for me to just have to change it back again in my environment. I can edit the systemwide zshrc, but then I have to watch out for package upgrades overwriting my changes.

All that needs to be done is remove the lines that reference vi-up-line-or-history and vi-down-line-or-history in /etc/zsh/zshrc.

Revision history for this message
Axel Beckert (xtaran) wrote :

JFTR: The according Debian bug has been tagged and closed as wontfix. Seems as if fixing this for vi users would make all Emacs users unhappy for the very same reason.

Changed in zsh (Debian):
status: Unknown → Fix Released
Revision history for this message
Tomasz 'Zen' Napierala (tzn) wrote :

Don't you want to be better Debian? This is insane and drives most people crazy.

Revision history for this message
Axel Beckert (xtaran) wrote : Re: [Bug 72054] Re: package defaults are unfriendly for users that use the 'viins' editing mode

Hi,

Tomasz 'Zen' Napierala wrote:
> Don't you want to be better Debian?

I don't understand this sentence -- there seem to be something
missing, either a word or a punctuation mark.

Do you mean "Don't you want to be better_,_ Debian?", "Don't you want
to be _a_ better Debian?" or "Don't you want to be better _than_
Debian?"?

  Regards, Axel
--
 ,''`. | Axel Beckert <email address hidden>, http://people.debian.org/~abe/
: :' : | Debian Developer, ftp.ch.debian.org Admin
`. `' | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE
  `- | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5

Revision history for this message
Ward (ward-wouts) wrote :

> I don't understand this sentence -- there seem to be something
> missing, either a word or a punctuation mark.

> Do you mean "Don't you want to be better_,_ Debian?", "Don't you want
> to be _a_ better Debian?" or "Don't you want to be better _than_
> Debian?"?

Ah, insult upon injury. Much easier than actually fixing the problem. For which I sent an effective fix in 2006 and more granular patches in 2008. It's almost been 6 years. Wonderful.

Incidentally, Fedora has none of these keymappings and zsh works wonderfully there. Someone might want to have look at that.

Ward

Revision history for this message
Tom (brommage) wrote : I'm interested in your profile

Hello!
I am Julia, I am 27 y.o.
I search for boy-friend.
My photos and new message for you here:

http://hotbrides.ru

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.