Nano cursor move issue with certain characters in line #372

Closed
opened 2026-01-30 21:50:13 +00:00 by claunia · 11 comments
Owner

Originally created by @uSlackr on GitHub (Sep 12, 2018).

Originally assigned to: @zadjii-msft on GitHub.

Using 1803 here, (but see the same issue with my insiders build at home)

Noticed while editing a pwsh script with nano but observed in other files as well
I'm ssh'd into a SUSE 27 svr from WSL - the issue is not apparent when using nano on WSL locally.
$TERM is xterm-256color

When moving the cursor backwards (to the left), the cursor & text on the screen get wonky.
First the cursor jumps to the beginning of line, then it moves to the far right of screen.

Originally created by @uSlackr on GitHub (Sep 12, 2018). Originally assigned to: @zadjii-msft on GitHub. Using 1803 here, (but see the same issue with my insiders build at home) Noticed while editing a _pwsh_ script with _nano_ but observed in other files as well I'm ssh'd into a SUSE 27 svr from WSL - the issue is not apparent when using nano on WSL locally. $TERM is xterm-256color When moving the cursor backwards (to the left), the cursor & text on the screen get wonky. First the cursor jumps to the beginning of line, then it moves to the far right of screen.
claunia added the Product-ConhostResolution-Fix-AvailableResolution-Fix-Committed labels 2026-01-30 21:50:13 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Sep 12, 2018):

What's the TERM variable set to on the SUSE machine? (echo $TERM)

While ssh'd into the box, could you paste the output of infocmp?

My first guess is that TERM it's not xterm or xterm-256color.
My second guess is that they're using an updated termcap that's got some new sequence we don't yet recognize.
Thanks!

@zadjii-msft commented on GitHub (Sep 12, 2018): What's the `TERM` variable set to on the SUSE machine? (`echo $TERM`) While ssh'd into the box, could you paste the output of `infocmp`? My first guess is that `TERM` it's not `xterm` or `xterm-256color`. My second guess is that they're using an updated termcap that's got some new sequence we don't yet recognize. Thanks!
Author
Owner

@uSlackr commented on GitHub (Sep 12, 2018):

Sorry. Looked at that and didn't add it. it's: xterm-256color. (Added to original post)

@uSlackr commented on GitHub (Sep 12, 2018): Sorry. Looked at that and didn't add it. it's: **xterm-256color**. (Added to original post)
Author
Owner

@uSlackr commented on GitHub (Sep 12, 2018):

xterm-256color is confirmed. infocmp output attached.

Thanks!

infocmp.txt

@uSlackr commented on GitHub (Sep 12, 2018): xterm-256color is confirmed. infocmp output attached. Thanks! [infocmp.txt](https://github.com/Microsoft/console/files/2376138/infocmp.txt)
Author
Owner

@uSlackr commented on GitHub (Sep 19, 2018):

@zadjii-msft do you need anything else from me on this?

@uSlackr commented on GitHub (Sep 19, 2018): @zadjii-msft do you need anything else from me on this?
Author
Owner

@zadjii-msft commented on GitHub (Sep 19, 2018):

@uSlackr Not currently, no. I've added it to my bug backlog, I'll investigate more soon.

@zadjii-msft commented on GitHub (Sep 19, 2018): @uSlackr Not currently, no. I've added it to my bug backlog, I'll investigate more soon.
Author
Owner

@arpsmack commented on GitHub (Nov 6, 2018):

@uSlackr I know this is a bit old but I ran into this today and thought I'd contribute.

I have the same problem with CentOS also using xterm-256color and the capability that seems to cause the problems is cbt (caret back tab).

You can change TERM to something that doesn't support cbt (xterm-color I think?), or you can recompile xterm-256color to remove the cbt capability. I recompiled it and it seems to fix the problem for me.

infocmp > ~/myterm.ti
# edit myterm.ti -- remove the "cbt=\E[Z" entry (rename the term too if you want)
sudo tic ~/myterm.ti
# if you renamed it, make sure to add a line to your .bashrc to change TERM
# export TERM=xterm-256color-nocbt

Hope that helps.

@arpsmack commented on GitHub (Nov 6, 2018): @uSlackr I know this is a bit old but I ran into this today and thought I'd contribute. I have the same problem with CentOS also using xterm-256color and the capability that seems to cause the problems is cbt (caret back tab). You can change TERM to something that doesn't support cbt (xterm-color I think?), or you can recompile xterm-256color to remove the cbt capability. I recompiled it and it seems to fix the problem for me. ``` infocmp > ~/myterm.ti # edit myterm.ti -- remove the "cbt=\E[Z" entry (rename the term too if you want) sudo tic ~/myterm.ti # if you renamed it, make sure to add a line to your .bashrc to change TERM # export TERM=xterm-256color-nocbt ``` Hope that helps.
Author
Owner

@uSlackr commented on GitHub (Nov 6, 2018):

@arpsmack Thanks for the tip.
I tried removing this "cbt=\E[Z," made sure the comma separators were correct and added -nocbt to the name in the top line. Compiled it, changed .bashrc and logged out/in. Terminal reported
"WARNING: terminal is not fully functional" and nano would not start.
I was able to use vi to revert changes. Not sure what I might have done wrong.

@uSlackr commented on GitHub (Nov 6, 2018): @arpsmack Thanks for the tip. I tried removing this "cbt=\E[Z," made sure the comma separators were correct and added -nocbt to the name in the top line. Compiled it, changed .bashrc and logged out/in. Terminal reported "WARNING: terminal is not fully functional" and nano would not start. I was able to use vi to revert changes. Not sure what I might have done wrong.
Author
Owner

@arpsmack commented on GitHub (Nov 6, 2018):

Aw man, sorry to hear that. Perhaps there are other complications from doing it within WSL. I'm SSHing into a vagrant VM running CentOS using the native Windows 10 OpenSSH.

Have you tried changing your TERM to something like xterm-color or linux? I've heard of other people having success with those.

@arpsmack commented on GitHub (Nov 6, 2018): Aw man, sorry to hear that. Perhaps there are other complications from doing it within WSL. I'm SSHing into a vagrant VM running CentOS using the native Windows 10 OpenSSH. Have you tried changing your TERM to something like `xterm-color` or `linux`? I've heard of other people having success with those.
Author
Owner

@uSlackr commented on GitHub (Nov 6, 2018):

No worries. I manage :-)

I just tried xterm-color and it seems to work! I'll try it for a couple days.

@uSlackr commented on GitHub (Nov 6, 2018): No worries. I manage :-) I just tried xterm-color and it seems to work! I'll try it for a couple days.
Author
Owner

@zadjii-msft commented on GitHub (Dec 5, 2018):

Okay, I've finally gotten some time to try and look at this.

I've got a CentOS 7.6 VM.
I'm connecting to it via WSL+Ubuntu, using ssh
I've got nano 2.3.1.
My Windows build is 18295, which is probably irrelevant - I'm a few weeks of console fixes (and breaks) ahead of the equivalent Insider's build #.

This looks fine to me:
nano-centos

(admittedly, there's a coloration bug I'm working on in another branch currently that's causing the header/footer to be the wrong color, but that's unrelated).

I'm hoping this was actually fixed in 1809, but another fix for tabstops went in to a recent internal build. If this re-surfaces after #283 hit's Insider's, feel free to re-activate, though I'd probably need more help reproing at that point.

@zadjii-msft commented on GitHub (Dec 5, 2018): Okay, I've finally gotten some time to try and look at this. I've got a CentOS 7.6 VM. I'm connecting to it via WSL+Ubuntu, using ssh I've got nano 2.3.1. My Windows build is 18295, which is probably irrelevant - I'm a few weeks of console fixes <sup>(and breaks)</sup> ahead of the equivalent Insider's build #. This looks fine to me: ![nano-centos](https://user-images.githubusercontent.com/18356694/49537900-07313300-f87f-11e8-8e4c-651091ad81a4.gif) (admittedly, there's a coloration bug I'm working on in another branch currently that's causing the header/footer to be the wrong color, but that's unrelated). I'm hoping this was actually fixed in 1809, but another fix for tabstops went in to a recent internal build. If this re-surfaces after #283 hit's Insider's, feel free to re-activate, though I'd probably need more help reproing at that point.
Author
Owner

@uSlackr commented on GitHub (Jan 19, 2019):

I verified the fix with Insiders 18312.1001. Thanks!

@uSlackr commented on GitHub (Jan 19, 2019): I verified the fix with Insiders 18312.1001. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#372