Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConEmu\CMDER and WSL | finding a non-broken terminal emulator #1738

Open
avielc opened this issue Oct 23, 2018 · 11 comments

Comments

Projects
3 participants
@avielc
Copy link

commented Oct 23, 2018

Issue was probably mentioned in many variations, But I can't find a proper closure for this subject. That's why this ticket is open.

Versions

ConEmu build: 180626 x32/x64
OS version: Windows 10 Pro 1803 17134.345 x32/x64
Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): using ubuntu1804 installed from windows store with support for WSL (out of beta on 1803)

Problem description

For a while I've been trying to get this bash to work through ssh with connecting to many servers in my company that run centos (currently on 7.5.XXX), a while ago there were a few 6.X).
I ran into a few issues (many), most were resolved, I'll specify in short the case and the resolution I found.

  1. broken text - typing over existing line I want to use, using the "history" function, text got overwritten although the line extended. - fixed using ~/.bashrc - export TERM=vt220
  2. copy\paste broken text\arrow keys\ browsing through 'nano' using arrow keys to move around - all those were broken as well, the nano part was most annoying, it was skipping lines and starting them at the right edge of the terminal windows - fixed using ~/.bashrc - export TERM=vt220

Actual problem - Ctrl+ K to delete a line in nano - text is broken and not seen on screen.
That's the only thing that is left unfixed (and is actually new to vt220)
using the common xterm-256colors, xterm, xterm-color would make this function to work, but all the other issues would return.

any chance you know which terminal emulator would work best? (I mean a TERM environment variable)

Steps to reproduce

Prerequisite
(Set your .bashrc with export TERM=vt220)
updated actually happens without connecting to another machine via ssh - so can be tested locally on bash, happens with wslbridge too

  1. open nano
  2. edit a few lines
  3. try to delete one with Ctrl+K

Actual results

the nano editor would look the same even though that line was deleted.

Expected results

the display should refresh and the line should've disappear

Any thoughts anyone? I'm banging my head hard trying to figure that one out, but using that "vt220' really turned things around for the best with all the bash\wsl issues everyone had here.

Thank you all!
@Maximus5 - Really love the cmder\conemu they are a gift for working with bash\cmd in tabbed window properly, don't ever stop!

@Maximus5 Maximus5 added the ansi label Oct 23, 2018

@Maximus5 Maximus5 added this to To Do in ANSI via automation Oct 23, 2018

@Maximus5

This comment has been minimized.

Copy link
Owner

commented Oct 23, 2018

I'll try to repro the issue with Ctrl+K.

But it would be better to fix both problems, so I need either description of broken text or (better) ansi log files with screenshots.

@avielc

This comment has been minimized.

Copy link
Author

commented Oct 23, 2018

if you could please explain to me the ansi log part.. not sure I follow...
I've added 2 screen shots -
first: cursor jump when moving through a file in nano so line details break.
cursorjump on arrow move

this is an example of broken text, that's not exactly what I aimed for (for me, when I brought up a line from "history" longer than 30 or so letters, trying to type in the middle of it will cause the text to "overwrite" the old text even though the actual line appends the text (i've added # at the beginning in order to press 'Enter" and reload the line and see it's ok.
brokentext

I'll try to catch more examples and add them, but this is the best for now,
the broken text and cursor jump usually works on files with long lines (a lot of place for the cursor to "run" on.

@avielc

This comment has been minimized.

Copy link
Author

commented Nov 7, 2018

So new info -
I found the history "rewrite" part appears when I specify "xterm-colors" under TERM environmental variable in the bashrc
in other words, xterm & xterm-256colors will have the case of the skipping cursed seen on the first GIF
while xterm-colors will cause the second issue to appear on commands loaded from history (either using the arrow keys or CTRL+R)
Any ideas? maybe any kind of emulator that wouldn't cause it?
the mild solution I found, was using vt220 as the $TERM, but that's a half baked solution, you get a lot of broken texts inside all sorts of tui based apps like nano, or mc and such. not to mention lack of colors.

So any kind of help on that topic, i'd really appreciate, thanks again!

@avielc

This comment has been minimized.

Copy link
Author

commented Nov 7, 2018

I think I found a solution for that, but I will do further testing in hope I don't destroy files in the background.
if i use "export TERM=vwmterm "
(went one by one over a few types of termcaps) it seemed to give both color, and not break any lines (YET!)
I'll be checking it for in a while, hopefully, it'll stay this awesome 👍

@Maximus5

This comment has been minimized.

Copy link
Owner

commented Nov 7, 2018

typing over existing line I want to use, using the "history" function, text got overwritten although the line extended.

Do you talk about bash prompt here?

@avielc

This comment has been minimized.

Copy link
Author

commented Nov 7, 2018

Yea, exactly that. My examples above are from bash in windows, That work through conemu/cmder.
Problem is, and i assume it’s a bash issue more than conemu, the interpretation of the termcaps aren’t correct enough to figure the buffer for some functions.
Arrow key scroll in nano editor, or modifying a line brought up from history.
In any case I managed to find a way to stabilize it though it’s still to early to say how stable it really is for the long run. And would suggest it as a resolution for that horrible “xterm” issues i’m sure other suffer from too.
What do you think?

@zaphod77

This comment has been minimized.

Copy link

commented Apr 20, 2019

try
set TERM=ansi

conemu can handle ansi. it's xterm emulation is buggy, most likely because it is passing through to windows 10s, which is incomplete. oddly enough CMDer has it fixed, and properly supports xterm.

@avielc

This comment has been minimized.

Copy link
Author

commented Apr 20, 2019

@zaphod77

This comment has been minimized.

Copy link

commented Apr 21, 2019

that said, even CMDer doesn't properly support mouse capture the way a real xterm does. really wish someone would just port xterm to win32 properly, and support the new windows 10 pty api.

@avielc

This comment has been minimized.

Copy link
Author

commented Apr 21, 2019

@zaphod77 - well unfortunately, I'm using CMDer but neither xterm nor ansi works well there mate 😞
the only solution I found this far that will make everything work as best as possible via cmder - WSL -bash thing is the following:
TERM= vwmterm
and wherever (usually centos) that nano won't open because it doesn't understand what vwmterm is,
i run the terminfo wget and tlc commands:

wget http://invisible-island.net/datafiles/current/terminfo.src.gz
gzip -d terminfo.src.gz
tic -sx terminfo.src
@zaphod77

This comment has been minimized.

Copy link

commented Apr 21, 2019

hmm.

i use cmder and run win32 ssh directly under that. and pico works just fine.

what editor is failing to work?

I just used default setup for CMDer.

Depending on what it used, as long as there is accurate terminfo or termcap data on the remote system.

Can you give me a test case that fails with non WSL ssh win32 under CMDer that isn't mouse related?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.