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

ssh.exe Error opening terminal #18

Closed
JBlond opened this Issue Oct 21, 2015 · 19 comments

Comments

Projects
None yet
10 participants
@JBlond

JBlond commented Oct 21, 2015

Connection to a linux remote host works fine, but I can open any graphical programm. Neither from cmd.exe nor powershell

user@host:~$ htop
htop
Error opening terminal: unknown.
user@host:~$ nano
nano
Error opening terminal: unknown.
user@host:~$
@MrAgent

This comment has been minimized.

Show comment
Hide comment
@MrAgent

MrAgent Oct 21, 2015

SSH will not automatically handle display traffic. You would need to have a Window manager on your client that can receive graphic input. If you have this, you could tunnel the display traffic through the SSH connection.

MrAgent commented Oct 21, 2015

SSH will not automatically handle display traffic. You would need to have a Window manager on your client that can receive graphic input. If you have this, you could tunnel the display traffic through the SSH connection.

@xcjs

This comment has been minimized.

Show comment
Hide comment
@xcjs

xcjs Oct 21, 2015

@MrAgent I think the issue that @JBlond pointed out is that command line "graphical" applications are not opening. htop and nano are command line applications that don't require a window manager.

xcjs commented Oct 21, 2015

@MrAgent I think the issue that @JBlond pointed out is that command line "graphical" applications are not opening. htop and nano are command line applications that don't require a window manager.

@JBlond

This comment has been minimized.

Show comment
Hide comment
@JBlond

JBlond Oct 21, 2015

ok pseudo graphical. However the apps work with putty.

JBlond commented Oct 21, 2015

ok pseudo graphical. However the apps work with putty.

@shanselman

This comment has been minimized.

Show comment
Hide comment
@shanselman

shanselman Oct 21, 2015

I was able to open htop after doing an "export TERM=xterm"

shanselman commented Oct 21, 2015

I was able to open htop after doing an "export TERM=xterm"

@JBlond

This comment has been minimized.

Show comment
Hide comment
@JBlond

JBlond Oct 21, 2015

When tho it is not practical it works with the export.

JBlond commented Oct 21, 2015

When tho it is not practical it works with the export.

@JBlond JBlond closed this Oct 21, 2015

@shanselman

This comment has been minimized.

Show comment
Hide comment
@shanselman

shanselman Oct 22, 2015

With respect, it really doesn't. Try htop, it's a mess. You're missing the clear commands send after, the prompt shows up over it, etc etc. Compare it to any other SSH terminal like bitvise and you'll see that your ssh terminal isn't in an acceptable state. You shouldn't close this issue, and you definitely shouldn't require this export as a weak workaround.

shanselman commented Oct 22, 2015

With respect, it really doesn't. Try htop, it's a mess. You're missing the clear commands send after, the prompt shows up over it, etc etc. Compare it to any other SSH terminal like bitvise and you'll see that your ssh terminal isn't in an acceptable state. You shouldn't close this issue, and you definitely shouldn't require this export as a weak workaround.

@JBlond

This comment has been minimized.

Show comment
Hide comment
@JBlond

JBlond Oct 22, 2015

Indeed the encoding isn't correct. I saw it when I changed to color.

JBlond commented Oct 22, 2015

Indeed the encoding isn't correct. I saw it when I changed to color.

@JBlond JBlond reopened this Oct 22, 2015

@shanselman

This comment has been minimized.

Show comment
Hide comment
@shanselman

shanselman commented Oct 22, 2015

Thanks @JBlond

@trisk

This comment has been minimized.

Show comment
Hide comment
@trisk

trisk Oct 22, 2015

Some background for this problem since there seems to be confusion here:

Full-screen text applications like htop are usually called curses-based applications, because they typically use a library like curses or ncurses to provide text-based drawing routines.

The TERM environment variable names a terminal type, which allows text applications to speak the correct control protocol for the terminal they're being displayed on (by loading the corresponding terminal definition from a terminfo or termcap database). The most common are probably: xterm/xterm-color/xterm-256color, vt100, and linux.

The SSH server normally passes the variable TERM from the client to the remote shell, since on Unix, TERM is always set to the correct terminal type (or local applications wouldn't work properly). A terminal definition with the same name must exist on both the local and remote system for this to work, though.

I don't know what terminal definitions the PowerShell window is compatible with, but it appears to set TERM to a terminal type unavailable on remote Unix systems, or doesn't set it at all. (Someone should check this with echo $TERM after logging in).

trisk commented Oct 22, 2015

Some background for this problem since there seems to be confusion here:

Full-screen text applications like htop are usually called curses-based applications, because they typically use a library like curses or ncurses to provide text-based drawing routines.

The TERM environment variable names a terminal type, which allows text applications to speak the correct control protocol for the terminal they're being displayed on (by loading the corresponding terminal definition from a terminfo or termcap database). The most common are probably: xterm/xterm-color/xterm-256color, vt100, and linux.

The SSH server normally passes the variable TERM from the client to the remote shell, since on Unix, TERM is always set to the correct terminal type (or local applications wouldn't work properly). A terminal definition with the same name must exist on both the local and remote system for this to work, though.

I don't know what terminal definitions the PowerShell window is compatible with, but it appears to set TERM to a terminal type unavailable on remote Unix systems, or doesn't set it at all. (Someone should check this with echo $TERM after logging in).

@godefroi

This comment has been minimized.

Show comment
Hide comment
@godefroi

godefroi Oct 22, 2015

My $TERM was set to "dumb". I would have thought that that would cause 'ls' to not send color codes, but that was apparently not correct.

godefroi commented Oct 22, 2015

My $TERM was set to "dumb". I would have thought that that would cause 'ls' to not send color codes, but that was apparently not correct.

@xcjs

This comment has been minimized.

Show comment
Hide comment
@xcjs

xcjs Oct 22, 2015

@trisk Thanks for the clarification! I always wondered what to call them.

xcjs commented Oct 22, 2015

@trisk Thanks for the clarification! I always wondered what to call them.

@robotdad

This comment has been minimized.

Show comment
Hide comment
@robotdad

robotdad Oct 23, 2015

I ran into this with nano. It works when using ssh in PowerShell but not from cmd. When launching nano in running ssh in cmd you get the Error opening terminal message.

robotdad commented Oct 23, 2015

I ran into this with nano. It works when using ssh in PowerShell but not from cmd. When launching nano in running ssh in cmd you get the Error opening terminal message.

@manojampalam

This comment has been minimized.

Show comment
Hide comment
@manojampalam

manojampalam Nov 11, 2015

Collaborator

Can you try these scenarios on the newer release?

Collaborator

manojampalam commented Nov 11, 2015

Can you try these scenarios on the newer release?

@robotdad

This comment has been minimized.

Show comment
Hide comment
@robotdad

robotdad Nov 12, 2015

Looks like tab completion is working as expected in cmd now. Vi works in cmd now. I'll try nano again tomorrow when I'm on a device that has it.

robotdad commented Nov 12, 2015

Looks like tab completion is working as expected in cmd now. Vi works in cmd now. I'll try nano again tomorrow when I'm on a device that has it.

@JBlond

This comment has been minimized.

Show comment
Hide comment
@JBlond

JBlond Nov 12, 2015

nano works now even with cmd.exe
htop has some encoding problem but it works.

With git bash I get an error when I tried to connect.

ssh_askpass: CreateProcess failed: 193

JBlond commented Nov 12, 2015

nano works now even with cmd.exe
htop has some encoding problem but it works.

With git bash I get an error when I tried to connect.

ssh_askpass: CreateProcess failed: 193
@JBlond

This comment has been minimized.

Show comment
Hide comment
@JBlond

JBlond Nov 12, 2015

I tried on Windows PowerShell I'm not sure what happens, cause the programm doesn't start.

JBlond commented Nov 12, 2015

I tried on Windows PowerShell I'm not sure what happens, cause the programm doesn't start.

@manojampalam

This comment has been minimized.

Show comment
Hide comment
@manojampalam

manojampalam Feb 1, 2016

Collaborator

Reactive if you still see any relevant issues

Collaborator

manojampalam commented Feb 1, 2016

Reactive if you still see any relevant issues

@thecliguy

This comment has been minimized.

Show comment
Hide comment
@thecliguy

thecliguy Jan 3, 2017

@manojampalam - I am running Windows 10 with the anniversary update and this is my experience:

  • Version 0.0.3.0, TERM is set to 'ansi', htop runs but the output is a garbled mess.
  • Version 0.0.4.0 and 0.0.5.0, TERM is set to 'dumb' and consequently htop (and pretty much any other ncurses 'graphical' program) refuses to run at all:
    Error opening terminal: unknown.

Issue #430 refers to my last point where the TERM is set to 'dumb'.

Was it a conscious decision to change the TERM type to 'dumb' in the last two builds - or is that an oversight? If it was intentional, then should I be manually changing the TERM type, and if so, what to?

Does this subject perhaps warrant some documentation on the wiki?

thecliguy commented Jan 3, 2017

@manojampalam - I am running Windows 10 with the anniversary update and this is my experience:

  • Version 0.0.3.0, TERM is set to 'ansi', htop runs but the output is a garbled mess.
  • Version 0.0.4.0 and 0.0.5.0, TERM is set to 'dumb' and consequently htop (and pretty much any other ncurses 'graphical' program) refuses to run at all:
    Error opening terminal: unknown.

Issue #430 refers to my last point where the TERM is set to 'dumb'.

Was it a conscious decision to change the TERM type to 'dumb' in the last two builds - or is that an oversight? If it was intentional, then should I be manually changing the TERM type, and if so, what to?

Does this subject perhaps warrant some documentation on the wiki?

@tradstone

This comment has been minimized.

Show comment
Hide comment
@tradstone

tradstone commented Jan 23, 2017

@thecliguy @manojampalam I experienced the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment