[issue980] make sudo-command-line() restore cursor position

Bernhard Tittelbach bts at bts.grml.org
Tue Apr 19 22:48:51 CEST 2011

New submission from Bernhard Tittelbach <xro at realraum.at>:

after using sudo-command-line, the CL-length will have increased by 5 chars. As
the cursor position stays the same, this amounts to a cursor offset with respect
to my typed test of 5 chars to the left.

please increase CURSOR position by 5 chars (==strlen "sudo "), so cursorposition
remains the same, relative to typed test


sudo-command-line() {
    [[ -z $BUFFER ]] && zle up-history
    [[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER" && CURSOR=$((CURSOR+5))

assignedto: ft
messages: 3732
nosy: btittelbach, ft
priority: feature
status: unread
title: make sudo-command-line() restore cursor position

GRML issue tracker <bts at bts.grml.org>

More information about the Bugs-changes mailing list