1

Many times I am entering long commands in my bash command line and I need to change a few characters near the middle of the command.

When I use putty, I can hold the left arrow and wait for the cursor to get to the point where I want to change the command.

When I use MobaXterm and I hold the left arrow, the cursor starts moving left but after 5 or 6 characters it starts deleting the characters, thus garbling my command.

How can I get MobaXterm to NOT delete characters when I hold the left arrow when I want to move the cursor?

MobaXterm Personal Edition 6.2 installed on Windows 7 64 bit

UPDATE: this only occurs with one account, but on many servers

Furthermore: I've noticed that once the characters are deleted, my cursor is now in an edit mode where I can use the vi commands: 'h' moves the cursor to the right, 'l' moves the cursor left, 'x' deletes characters, 'i' puts me in insert mode, etc.

4
  • It sounds to me like your TERM is not getting properly set or something. What do you see if you echo $TERM. Hopefully something like linux, or xterm?
    – Zoredache
    Commented Nov 14, 2014 at 22:27
  • @utrecht - I have MobaXterm Personal Edition 6.2 and I also tried the portable edition, 7.3. It happens with both of them. It also happens in many different sessions on many different servers at work, all running RHEL. Commented Nov 14, 2014 at 22:28
  • @utrecht - windows 7, 64-bit Commented Nov 14, 2014 at 22:38
  • So I noticed something, I've tried this on multiple servers and it happens on all the servers. I've tried this with multiple accounts and it only happens with one account. The account that has the issue is included in the video and there seems to be a newline after the $TERM variable. Furthermore, as I hold left and it deletes the characters, it seems to have changed to edit mode. once the characters are deleted (as shown in the video), I can navigate using vi commands: 'x' deletes, 'h' moves left, 'l' moves right. Is there some special setting to turn on vi edit mode on the command line? Commented Nov 14, 2014 at 22:44

1 Answer 1

3

It seems that the vi mode has been enabled in bash. This can be disabled by issuing set -o emacs. Once the latter command has been executed and the cursor is moved to the left, the characters will not be deleted anymore.

1
  • 1
    I found that the .bash_profile had set -o vi in it. problem solved! Commented Nov 14, 2014 at 22:54

You must log in to answer this question.

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