JOE editor handles enter key incorrectly - beginning of line #3050

Closed
opened 2026-01-30 23:11:48 +00:00 by claunia · 8 comments
Owner

Originally created by @robvarga on GitHub (Aug 1, 2019).

Originally assigned to: @zadjii-msft on GitHub.

Environment


Windows build number: [Version 10.0.18362.267] Windows 10 Professional Version 1903
Windows Terminal version (if applicable): whatever is out-of-the-box

Any other software?
  • Ubuntu 18.04.LTS from the Microsoft Store fully updated with
    sudo apt update ; sudo apt upgrade
  • The joe editor installed in Ubuntu with
    sudo apt install joe

Steps to reproduce

  1. Start the joe editor with a new file without specifying a filename
  2. Type 3 lines at least to see what happens, e.g.:
line1
line2
line3
  1. Go back with the cursor to the beginning of line2.
  2. Press the ENTER key.

Expected behavior

A new line should be inserted in the place of the cursor and the part of the file starting with the cursor position was in should be scrolled down on the screen and the last shown line should scroll out (disappear) and the cursor should move one line down.

I.e. you should see

line1

line2
line3

and the new cursor position should be at the beginning of line2

Note that after saving the file, the expected behavior is what correctly happens in the file data, only the display behavior is incorrect.

Note, that this worked correctly in Windows 1803 with the same Ubuntu 18.04 LTS and joe versions. The upgrade to Windows 1903 broke this, and reinstalling joe and reinstalling the entire Ubuntu 18.04 LTS distribution did not fix this either.

Actual behavior

No scrolling of the part after the cursor happens, instead the line the cursor was in is cleared (becomes empty, not disappear), and the cursor (correctly) moves down to the beginning of the next line.

I.e. you see

line1

line3

and the cursor position is at the beginning of line3.

Note that after saving the file, the expected behavior is what correctly happens to the file data, only the display behavior is incorrect.

Originally created by @robvarga on GitHub (Aug 1, 2019). Originally assigned to: @zadjii-msft on GitHub. <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ``` Windows build number: [Version 10.0.18362.267] Windows 10 Professional Version 1903 Windows Terminal version (if applicable): whatever is out-of-the-box Any other software? ``` - Ubuntu 18.04.LTS from the Microsoft Store fully updated with `sudo apt update ; sudo apt upgrade` - The joe editor installed in Ubuntu with `sudo apt install joe` # Steps to reproduce 1. Start the joe editor with a new file without specifying a filename 2. Type 3 lines at least to see what happens, e.g.: ``` line1 line2 line3 ``` 3. Go back with the cursor to the beginning of line2. 4. Press the ENTER key. # Expected behavior A new line should be inserted in the place of the cursor and the part of the file starting with the cursor position was in should be scrolled down on the screen and the last shown line should scroll out (disappear) and the cursor should move one line down. I.e. you should see ``` line1 line2 line3 ``` and the new cursor position should be at the beginning of line2 **Note that after saving the file, the expected behavior is what correctly happens in the file data, only the display behavior is incorrect.** **Note, that this worked correctly in Windows 1803 with the same Ubuntu 18.04 LTS and joe versions. The upgrade to Windows 1903 broke this, and reinstalling joe and reinstalling the entire Ubuntu 18.04 LTS distribution did not fix this either.** # Actual behavior No scrolling of the part after the cursor happens, instead the line the cursor was in is cleared (becomes empty, not disappear), and the cursor (correctly) moves down to the beginning of the next line. I.e. you see ``` line1 line3 ``` and the cursor position is at the beginning of line3. **Note that after saving the file, the expected behavior is what correctly happens to the file data, only the display behavior is incorrect.**
Author
Owner

@zadjii-msft commented on GitHub (Aug 27, 2019):

That's very odd, I'm not seeing this with joe 4.6-1, which apt is telling me is the most up-to-date version. @robvarga what version of joe were you seeing this on? Do you have any other config for joe that I can use to repro this?

Are you using screen or tmux (or something similar)?

What's your TERM set to?

Are you running joe via an ssh connection?

In fact, I actually can't get this to repro on a fresh 1903 install either, so I'm really curious what's causing this regression.

@zadjii-msft commented on GitHub (Aug 27, 2019): That's very odd, I'm not seeing this with joe 4.6-1, which apt is telling me is the most up-to-date version. @robvarga what version of `joe` were you seeing this on? Do you have any other config for joe that I can use to repro this? Are you using `screen` or `tmux` (or something similar)? What's your `TERM` set to? Are you running joe via an ssh connection? In fact, I actually can't get this to repro on a fresh 1903 install either, so I'm really curious what's causing this regression.
Author
Owner

@robvarga commented on GitHub (Aug 27, 2019):

Hi Mike (@zadjii-msft),

thanks for your attention.

Please find the answers between the lines.

That's very odd, I'm not seeing this with joe 4.6-1, which apt is telling me is the most up-to-date version. @robvarga what version of joe were you seeing this on?

I am use using the version joe 4.6-1

Do you have any other config for joe that I can use to repro this?

I did not modify anything in joe config that I am aware of, /etc/joe content list is as follows below:

$ ls -l /etc/joe/
total 308
lrwxrwxrwx 1 root root    27 Aug  1 10:59 editorrc -> ../../var/lib/misc/editorrc
-rw-r--r-- 1 root root 10890 Feb 17  2018 ftyperc
-rw-r--r-- 1 root root 44242 Feb 17  2018 jicerc.ru
-rw-r--r-- 1 root root 41840 Feb 17  2018 jmacsrc
-rw-r--r-- 1 root root 44422 Feb 17  2018 joerc
-rw-r--r-- 1 root root 43345 Feb 17  2018 joerc.zh_TW
-rw-r--r-- 1 root root 35133 Feb 17  2018 jpicorc
-rw-r--r-- 1 root root 37315 Feb 17  2018 jstarrc
-rw-r--r-- 1 root root 36016 Feb 17  2018 rjoerc
-rw-r--r-- 1 root root  1251 Feb 17  2018 shell.csh
-rw-r--r-- 1 root root  2822 Feb 17  2018 shell.sh

I have one change which I made in my ~/.bashrc, which comes to my mind, but that is unlikely to matter, as it is a color-related change in the prompt:

this is contained my ~/.bashrc for one of the lines mentioning PS1:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '

whereas the /etc/skel/.bashrc contains the below in the corresponding line:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

The difference is the \033[01;36m vs the original \033[01;34m replacing dark blue with lighter blue color for the actual directory in the prompt (if I correctly remember what it does).

Are you using screen or tmux (or something similar)?

Nope, I am using the stock Ubuntu icon added by installing the Ubuntu 18.04 LTS app from the Microsoft Store.

What's your TERM set to?

$ echo $TERM
xterm-256color

Are you running joe via an ssh connection?

Nope, local machine local Ubuntu icon in start menu.

In fact, I actually can't get this to repro on a fresh 1903 install either, so I'm really curious what's causing this regression.

It is not a fresh 1903, it was upgraded from 1803 in one step.

I had an earlier installation of Ubuntu 18.04-LTS which worked fine on Windows 10 1803, and broke after the upgrade to Windows 10 1903.

I removed and reinstalled joe on that installation, the bug remained.

I removed the entire Ubuntu installation with Add remove programs, rebooted (twice I believe), and then reinstalled Ubuntu 18.04-LTS. The bug was there in the fresh Ubuntu install.

I did not try to remove or disable and then reinstall or re-enable WSL itself.

I tried both in a maximized window and in a smaller (default-sized) window.

My screen resolution is 2560x1440.

Please find the properties pages of my Ubuntu (bash) app and the redacted output of the set command and the output of dpkg -l command attached to this comment.

Ubuntu-Properties-Colors
Ubuntu-Properties-Font
Ubuntu-Properties-Layout
Ubuntu-Properties-Options
Ubuntu-Properties-Terminal
set-output.txt
dpkg-output.txt

@robvarga commented on GitHub (Aug 27, 2019): Hi Mike (@zadjii-msft), thanks for your attention. Please find the answers between the lines. > > > That's very odd, I'm not seeing this with joe 4.6-1, which apt is telling me is the most up-to-date version. @robvarga what version of `joe` were you seeing this on? I am use using the version joe 4.6-1 > Do you have any other config for joe that I can use to repro this? > I did not modify anything in joe config that I am aware of, /etc/joe content list is as follows below: ``` $ ls -l /etc/joe/ total 308 lrwxrwxrwx 1 root root 27 Aug 1 10:59 editorrc -> ../../var/lib/misc/editorrc -rw-r--r-- 1 root root 10890 Feb 17 2018 ftyperc -rw-r--r-- 1 root root 44242 Feb 17 2018 jicerc.ru -rw-r--r-- 1 root root 41840 Feb 17 2018 jmacsrc -rw-r--r-- 1 root root 44422 Feb 17 2018 joerc -rw-r--r-- 1 root root 43345 Feb 17 2018 joerc.zh_TW -rw-r--r-- 1 root root 35133 Feb 17 2018 jpicorc -rw-r--r-- 1 root root 37315 Feb 17 2018 jstarrc -rw-r--r-- 1 root root 36016 Feb 17 2018 rjoerc -rw-r--r-- 1 root root 1251 Feb 17 2018 shell.csh -rw-r--r-- 1 root root 2822 Feb 17 2018 shell.sh ``` I have one change which I made in my ~/.bashrc, which comes to my mind, but that is unlikely to matter, as it is a color-related change in the prompt: this is contained my ~/.bashrc for one of the lines mentioning PS1: ``` PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ ' ``` whereas the /etc/skel/.bashrc contains the below in the corresponding line: ``` PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' ``` The difference is the \033[01;36m vs the original \033[01;34m replacing dark blue with lighter blue color for the actual directory in the prompt (if I correctly remember what it does). > Are you using `screen` or `tmux` (or something similar)? > Nope, I am using the stock Ubuntu icon added by installing the Ubuntu 18.04 LTS app from the Microsoft Store. > What's your `TERM` set to? > ``` $ echo $TERM xterm-256color ``` > Are you running joe via an ssh connection? > Nope, local machine local Ubuntu icon in start menu. > In fact, I actually can't get this to repro on a fresh 1903 install either, so I'm really curious what's causing this regression. It is not a fresh 1903, it was upgraded from 1803 in one step. I had an earlier installation of Ubuntu 18.04-LTS which worked fine on Windows 10 1803, and broke after the upgrade to Windows 10 1903. I removed and reinstalled joe on that installation, the bug remained. I removed the entire Ubuntu installation with Add remove programs, rebooted (twice I believe), and then reinstalled Ubuntu 18.04-LTS. The bug was there in the fresh Ubuntu install. I did not try to remove or disable and then reinstall or re-enable WSL itself. I tried both in a maximized window and in a smaller (default-sized) window. My screen resolution is 2560x1440. Please find the properties pages of my Ubuntu (bash) app and the redacted output of the set command and the output of dpkg -l command attached to this comment. ![Ubuntu-Properties-Colors](https://user-images.githubusercontent.com/2808019/63807510-25175a00-c91e-11e9-95f5-09cf1dc1533d.PNG) ![Ubuntu-Properties-Font](https://user-images.githubusercontent.com/2808019/63807512-25aff080-c91e-11e9-827c-307ac6359294.PNG) ![Ubuntu-Properties-Layout](https://user-images.githubusercontent.com/2808019/63807513-25aff080-c91e-11e9-9a92-599f94bd9cc6.PNG) ![Ubuntu-Properties-Options](https://user-images.githubusercontent.com/2808019/63807514-25aff080-c91e-11e9-8b50-97d1fbeb761c.PNG) ![Ubuntu-Properties-Terminal](https://user-images.githubusercontent.com/2808019/63807516-26488700-c91e-11e9-9524-55e72697dc6f.PNG) [set-output.txt](https://github.com/microsoft/terminal/files/3548095/set-output.txt) [dpkg-output.txt](https://github.com/microsoft/terminal/files/3548117/dpkg-output.txt)
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 28, 2019):

@zadjii-msft I can reproduce this with 19H1 conhost, but not the latest off master.

@DHowett-MSFT commented on GitHub (Aug 28, 2019): @zadjii-msft I _can_ reproduce this with 19H1 conhost, but not the latest off master.
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 28, 2019):

I think @j4james fixed this in #1807, actually. The offending VT coming out of joe boils down to this:

\e[H\e[2J\e[1;50r\e[r\nHELLO followed by \e[H\r\n\e[L\e[K

In master, \e[L inserts a blank line and retains the cursor position. In 19H1, it doesn't insert the blank line because it erroneously believes it's "outside the margins".

I just tested the working repro (incl. joe 4) across microsoft/terminal@0e6f290, and that commit definitely fixed it.

@DHowett-MSFT commented on GitHub (Aug 28, 2019): I think @j4james fixed this in #1807, actually. The offending VT coming out of joe boils down to this: `\e[H\e[2J\e[1;50r\e[r\nHELLO` followed by `\e[H\r\n\e[L\e[K` In master, `\e[L` inserts a blank line and retains the cursor position. In 19H1, it doesn't insert the blank line because it erroneously believes it's "outside the margins". I just tested the working repro (incl. joe 4) across microsoft/terminal@0e6f290, and that commit definitely fixed it.
Author
Owner

@mdebee commented on GitHub (Feb 22, 2020):

See the same behaviour with a freshly installed Debian on Windows 10!

@mdebee commented on GitHub (Feb 22, 2020): See the same behaviour with a freshly installed Debian on Windows 10!
Author
Owner

@j4james commented on GitHub (Feb 22, 2020):

@mdebee I'm assuming you're using the old conhost console, and not the new Windows Temrinal? If that's that case, you likely won't have this fix yet, unless you have an insider preview build of Windows. The 20H1 update is only expected to be released around May I think.

If you try with the latest version of the Windows Terminal, though, that should work.

@j4james commented on GitHub (Feb 22, 2020): @mdebee I'm assuming you're using the old conhost console, and not the new Windows Temrinal? If that's that case, you likely won't have this fix yet, unless you have an insider preview build of Windows. The 20H1 update is only expected to be released around May I think. If you try with the latest version of the Windows Terminal, though, that should work.
Author
Owner

@robvarga commented on GitHub (Feb 26, 2020):

@mdebee I'm assuming you're using the old conhost console, and not the new Windows Temrinal? If that's that case, you likely won't have this fix yet, unless you have an insider preview build of Windows. The 20H1 update is only expected to be released around May I think.

If you try with the latest version of the Windows Terminal, though, that should work.

Hi @j4james,
How can we make this change in an existing install of Ubuntu on build 1903?
Thanks and best regards,
Robert

@robvarga commented on GitHub (Feb 26, 2020): > @mdebee I'm assuming you're using the old conhost console, and not the new Windows Temrinal? If that's that case, you likely won't have this fix yet, unless you have an insider preview build of Windows. The 20H1 update is only expected to be released around May I think. > > If you try with the latest version of the Windows Terminal, though, that should work. Hi @j4james, How can we make this change in an existing install of Ubuntu on build 1903? Thanks and best regards, Robert
Author
Owner

@j4james commented on GitHub (Feb 26, 2020):

@robvarga If you're asking how to install Windows Terminal, the instructions are on the front page of this repo.

If you're asking how to update the conhost executable, you'd probably need to build the code yourself, and then use that build to replace the version that comes with the OS. I think there's an issue somewhere describing how to do that, but it's not officially sanctioned behaviour. Your best bet is just to use Windows Terminal, or wait for the next Windows update.

@j4james commented on GitHub (Feb 26, 2020): @robvarga If you're asking how to install Windows Terminal, the instructions are on the [front page](https://github.com/microsoft/terminal#installing-and-running-windows-terminal) of this repo. If you're asking how to update the conhost executable, you'd probably need to build the code yourself, and then use that build to replace the version that comes with the OS. I think there's an issue somewhere describing how to do that, but it's not officially sanctioned behaviour. Your best bet is just to use Windows Terminal, or wait for the next Windows update.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3050