2

Often when using bash I am used to using the keys ^A and ^E to go to the beginning and end of line, and the arrow keys to move from character to character without erasing. Every now and then, I enter certain tools where it completely screws up my hotkeys, and nothing works. My keyboard is remapped making the delete key the backspace key, ^W now erases words and it is impossible for me to correct anything in the command line because just about every key for editing the commands typed puts garbage characters to the terminal. This often happens to me when entering passwords or SQLPlus in a UNIX terminal.

I don't even know if this is bash or something else, but someone told me too look at this command:

  $ stty -a
  speed 38400 baud; rows 37; columns 100; line = 0;
  intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = ^Z;
  start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0
  ;
  -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
  -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel

  opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
  isig icanon iexten echo -echoe -echok -echonl -noflsh -tostop -echoctl -echoke

Anyhow, I don't know what I am looking at here, but I do recognize some of the shortcuts ^W and ^U. How can I redefine things to make this weird terminal settings act like regular bash

3 Answers 3

0

Most of what you describe is provided by readline, so if the utility you are using doesn't support readline or something equivalent you are out of luck. The terminal only interprets a very limited set of escape codes, mainly the ones for deleting the previous word (^W) and for deleting the whole line (^U), for the rest (^A, ^E, ...) the application has to do the work.

1

I think you want the reset command, in the ncurses package.

If you rather mean inside of sqlplus, then the other answer is correct: there's nothing you can do, because sqlplus is an ancient and doesn't support readline.

1
  • 2
    I think I misunderstood your question. I thought you meant that your terminal got screwed up outside of sqlplus. If you mean inside of sqlplus, then ninjalj is correct: there's nothing you can do, because sqlplus is an ancient piece of crap that doesn't use readline. Nov 2, 2011 at 13:06
0

You can use rlwrap

Unfortunately, if you are on client site, you can't compile it. But you can download a binary version here

Have fun!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .