cloudius-systems / mgmt

20 stars 11 forks source link

No echo when running command from Crsh #53

Open nyh opened 10 years ago

nyh commented 10 years ago

Crsh switches the terminal to raw mode (not exactly, but close enough) when reading the command line, so it gets the input after each character, and does it own echo. However, just before we run a command, we need to switch back to cooked mode, so that the command we run can behave as Unix programs expect, to be run in cooked mode (and get echo and a line discipline).

I remember we got this working correctly, but apparently it longer is. If you run

$ make image=memcached.none,mgmt.full
$ scripts/run.py
[/]% run memcached.so -u root

You see memcached.so runs without echo enabled (if you type anything, you don't see what you type). OSv is not hung at this point, it's just not echoing characters.

To see that echo is working outside crsh, run the same memcached directly without crsh:

$ make image=memcached
$ scripts/run.py

and see how the input characters are echoed.