Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.61k stars 575 forks source link

ConEmu + Mosh + Tmux split + backspace inserts a newline at bottom of screen #1960

Open jakemco opened 5 years ago

jakemco commented 5 years ago

Versions

ConEmu build: 190714 alpha x64 OS version: Windows 1809 x64 Used Task: Ubuntu WSL Bash

slightly modified task command from default to start in home directory:

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -C~ -cur_console:pm:/mnt 

Local Versions

Local OS version: Ubuntu 18.04.2 LTS (WSL) Local Bash version: 4.4.19(1)-release x64 Local Mosh version: 1.3.2 (from ubuntu: sudo apt-get install mosh) Local $TERM value: xterm-256-color

Remote Versions

Remote OS Version: Ubuntu 16.04.03 LTS Remote Bash Version: 4.3.48(1) Remote Mosh-Server version: 1.2.5 Remote Tmux version: 2.1 Remote $TERM value: xterm-256color Remote $TERM value in tmux: screen-256color

Note: I also repro'd this on a CentOS 7 remote host with Tmux 2.2

Problem description

When using ConEmu + Mosh + remote Tmux, making a split pane and hitting backspace in the right pane when it's all the way scrolled down causes a newline to be inserted and the whole screen's layout to break.

Note: this does not repro when I use the default WSL console, this does not repro when I use ssh instead of mosh, this does not repro on local tmux. Only the combination of ConEmu + Mosh seems to trigger this bug on the remote tmux.

Steps to reproduce

  1. mosh to remote server (https://mosh.org/), eg: $ mosh user@host
  2. open a tmux session, eg: $ tmux
  3. create a vertical split, eg: <ctrl>+b then %
  4. fill the right split with content so the command prompt is at the bottom of the screen, eg: $ ls var/log<tab><tab><tab><tab>... until screen is full, <ctrl>+c to get an empty prompt
  5. start to type a command, hit backspace, eg: $ asdfasdf<BS>

Actual results

entire screen jumps up one line (including tmux status bar), cursor is now in middle of green status bar, running clear resets part of the pane, but doesn't redraw the status bar, need to detach and re-attach to redraw whole screen.

Expected results

just one character disappears as when normally hitting backspace

Additional files

local versions: screenshot 2019-07-30 07 56 53

remote versions: Screenshot 2019-07-30 08 05 32

just before hitting backspace: Screenshot 2019-07-30 08 12 37

just after hitting backspace: Screenshot 2019-07-30 08 12 41

quark-zju commented 4 years ago

Does this issue reproduce if you disable "Inject ConEmuHk" (Settings -> Featurs -> In-console options)?

upya4ko commented 4 years ago

disable "Inject ConEmuHk" (Settings -> Featurs -> In-console options)?

It seems help with this issue https://github.com/Maximus5/ConEmu/issues/1873

jakemco commented 4 years ago

@quark-zju That appears to have fixed it. What's the trade-off I'm making here by disabling that?

jakemco commented 4 years ago

Although, now I've turned "inject ConEmuHk" back on and it won't repro, so I'm not sure if that was it?

quark-zju commented 4 years ago

@jakemco I think a restart of ConEmu is needed for ConEmuHk to be effective. Did you try that?

My understanding is a lot of features that ConEmuHk supported (ex. ANSI colors) have been supported by recent Windows 10 natively. Applications that are aware of the Windows 10 feature can set ENABLE_VIRTUAL_TERMINAL_PROCESSING and get better supported. ConEmuHk might somehow conflict with the Windows 10 native features and therefore cause random issues. The Windows 10 feature has been there for a few years. So perhaps some older programs that are not updated and are specifically designed for ConEmu need ConEmuHk. I personally haven't seen such older programs yet.

jakemco commented 4 years ago

I restarted both times (after turning it off and turning it back on), but I can test it again just in case something was weird last time.

ziggythehamster commented 4 years ago

For the similar issue #1873, I'm able to reproduce this with ConEmu->MSYS2 connector->SSH, so I'm not sure if the enhanced Windows 10 thing affects this