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.

migrated from serverfault.com Nov 14 '14 at 23:43

This question came from our site for system and network administrators.

  • 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 Nov 14 '14 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. – Colorado Techie Nov 14 '14 at 22:28
  • @utrecht - windows 7, 64-bit – Colorado Techie Nov 14 '14 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? – Colorado Techie Nov 14 '14 at 22:44
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
    I found that the .bash_profile had set -o vi in it. problem solved! – Colorado Techie Nov 14 '14 at 22:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.