zsh-users
 help / color / mirror / code / Atom feed
* Cursor position in shell history
@ 2012-02-12 17:21 Javier Marcet
  2012-02-12 21:27 ` Frank Terbeck
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Marcet @ 2012-02-12 17:21 UTC (permalink / raw)
  To: zsh-users

Hi,

Last month I set up an Ubuntu based system, where I use zsh, as in all
the unix systems I manage. There is one thing which is driving me mad.
When I use the 'up arrow' to move through shell's history, the cursor is
placed at the start of the line instead of at the end. This only happens
in Ubuntu.

I use the same .zsh folder with my settings and neither the global profile
nor the global zsh settings  (/etc/zsh) contain anything which me causing
it.

In readline there is a setting, history-preserve-point, which changes this.

What would be the best way to change this behavior?


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

* Re: Cursor position in shell history
  2012-02-12 17:21 Cursor position in shell history Javier Marcet
@ 2012-02-12 21:27 ` Frank Terbeck
  2012-02-12 22:59   ` Javier Marcet
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Terbeck @ 2012-02-12 21:27 UTC (permalink / raw)
  To: Javier Marcet; +Cc: zsh-users

Javier Marcet wrote:
> Last month I set up an Ubuntu based system, where I use zsh, as in all
> the unix systems I manage. There is one thing which is driving me mad.
> When I use the 'up arrow' to move through shell's history, the cursor is
> placed at the start of the line instead of at the end. This only happens
> in Ubuntu.

Yes. Ubuntu basically uses the package from debian, which causes this.

> I use the same .zsh folder with my settings and neither the global profile
> nor the global zsh settings  (/etc/zsh) contain anything which me causing
> it.

Oh but it does. It's the global zshrc:

[...]
[[ -z "$terminfo[cuu1]" ]] || bindkey -M viins "$terminfo[cuu1]" vi-up-line-or-history
[[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" vi-up-line-or-history
[...]

There is more of this stuff in there. Change it to your liking.

FWIW, there is a bug about this in Debian's BTS:

  <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=383737>

The position of the maintenance team so far is: It was changed to more
vi-ish, and up to that point *two* people bothered to tell the
maintainer. So it stays.

My current view is this (/me puts his debian hat on): Move to a proper
way based on $terminfo entirely to setup keys. That way everything below
the "ncurses fogyatekos" comment can go away, too. Because it's really
not the fault of ncurses that some value may be off here (but that's not
relevant here - so I'll drop that thought).

Such a move will probably cause some breakage, but is the right thing to
do. And since we'll break something anyway, I think we should get rid of
those bindings, as well, and let the user decide whether or not he wants
them or not.

Regards, Frank


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

* Re: Cursor position in shell history
  2012-02-12 21:27 ` Frank Terbeck
@ 2012-02-12 22:59   ` Javier Marcet
  0 siblings, 0 replies; 3+ messages in thread
From: Javier Marcet @ 2012-02-12 22:59 UTC (permalink / raw)
  To: Frank Terbeck; +Cc: zsh-users

On Sun, Feb 12, 2012 at 22:27, Frank Terbeck <ft@bewatermyfriend.org> wrote:

>> Last month I set up an Ubuntu based system, where I use zsh, as in all
>> the unix systems I manage. There is one thing which is driving me mad.
>> When I use the 'up arrow' to move through shell's history, the cursor is
>> placed at the start of the line instead of at the end. This only happens
>> in Ubuntu.

> Yes. Ubuntu basically uses the package from debian, which causes this.

>> I use the same .zsh folder with my settings and neither the global profile
>> nor the global zsh settings  (/etc/zsh) contain anything which me causing
>> it.

> Oh but it does. It's the global zshrc:

> [...]
> [[ -z "$terminfo[cuu1]" ]] || bindkey -M viins "$terminfo[cuu1]" vi-up-line-or-history
> [[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" vi-up-line-or-history
> [...]

> There is more of this stuff in there. Change it to your liking.

Oh damn it, I thought I checked everything but you're absolutely right.

> FWIW, there is a bug about this in Debian's BTS:

>  <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=383737>

> The position of the maintenance team so far is: It was changed to more
> vi-ish, and up to that point *two* people bothered to tell the
> maintainer. So it stays.

But it is not vi-ish either, if it were, the cursor would stay at the
same position,
not always go to column 0.

> My current view is this (/me puts his debian hat on): Move to a proper
> way based on $terminfo entirely to setup keys. That way everything below
> the "ncurses fogyatekos" comment can go away, too. Because it's really
> not the fault of ncurses that some value may be off here (but that's not
> relevant here - so I'll drop that thought).

> Such a move will probably cause some breakage, but is the right thing to
> do. And since we'll break something anyway, I think we should get rid of
> those bindings, as well, and let the user decide whether or not he wants
> them or not.

Well, the way I see it is that on anything not Debian based, I never ever saw
that behavior. Be it Linux, BSD, or whatever.

Although I also find hard to believe only two people have complained.

Anyway, _thanks_ a lot, this has been bothering me since I first installed that
Ubuntu machine.


-- 
Javier Marcet <jmarcet@gmail.com>


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

end of thread, other threads:[~2012-02-12 23:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-12 17:21 Cursor position in shell history Javier Marcet
2012-02-12 21:27 ` Frank Terbeck
2012-02-12 22:59   ` Javier Marcet

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