Bug 627 - Sudo'd shell: command line editing doesn't work
Sudo'd shell: command line editing doesn't work
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.3
PC Linux
: low low
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-03 01:25 MST by Konrad Schwarz
Modified: 2013-12-04 08:54 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konrad Schwarz 2013-12-03 01:25:28 MST
After creating a root shell via sudo sh, vi-style command line editing
(set -o vi) no longer works: the ESC character used to switch to
command mode is interpreted literally, i.e., echoed to the screen.
TTY settings as reported by stty are unchanged.

This is probably not a Sudo bug per se, but probably the result of
some interaction I don't understand; neither the manual nor
brief googling provide an explanation.

It might be worthwhile adding the appropriate information to the
manual or a FAQ.
Comment 1 Todd C. Miller 2013-12-03 08:09:00 MST
On many systems, root's shell does not support command line editing.  For example, Debian-based Linux systems (including Ubuntu) use dash as /bin/sh.  That shell does not have command line editing compiled in.  If you want command line editing, try running "sudo bash" instead.
Comment 2 Todd C. Miller 2013-12-04 08:54:54 MST
You can also use "sudo -s" as a shortcut to run your shell as root, rather than the shell configured for the root account.