Cygwin cursor won't go to beginning

0

Wondering if anyone else has seen this and has a solution:

  1. Context: Cygwin on Windows 7, ssh into Ubutntu 16.04.6
  2. Spend some time in the shell, so your command history has something in it.
  3. press Up Arrow to see previous commands
  4. press Home (or left arrow repeatedly) to get to the beginning of the line

RESULT: the cursor won't go all the way to the beginning of the line. It'll stop about 10 chars short and won't let you go any farther. For example: [prompt text]$ ls /somedir/anotherdir/ Instead of the cursor going to the space before "ls", it only goes to the "t" in "somesdir" It's impossible to go back further to the beginning of the command (end of the prompt).

EXPECT: Home takes the cursor to just left of the "l" in "ls"

Thanks to anyone who has a solution!

DanH

Posted 2019-09-02T18:23:02.817

Reputation: 1

Answers

0

If you just want to 'fix' the prompt, type reset. It'll reset the prompt back to normal for you.

As to what's happening it appears to be normally caused by a long command in your history, overflowing the current line causing a weirdly formatted prompt. I'm sure this isn't the only way to have this occur, as I've had amusing situations where the prompt wouldn't show any characters, instead showing the prompt immediately upon anything being entered. -- https://unix.stackexchange.com/questions/105958/terminal-prompt-not-wrapping-correctly explains it better than I can.

djsmiley2k TMW

Posted 2019-09-02T18:23:02.817

Reputation: 5 937

Thanks, @djsmiley2k, appreciate the help. You got no characters!? That's pretty bad. I've had long commands cause the problem and long commands not cause the problem - it's intermittent. Same for you? .... And, any way around it? e.g., it's a bummer to have to retype the long commands from scratch.... – DanH – 2019-09-03T18:27:41.853