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

ssh.exe Error opening terminal #18

Closed
JBlond opened this issue Oct 21, 2015 · 21 comments
Closed

ssh.exe Error opening terminal #18

JBlond opened this issue Oct 21, 2015 · 21 comments

Comments

@JBlond
Copy link

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
Copy link

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
Copy link

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
Copy link
Author

JBlond commented Oct 21, 2015

ok pseudo graphical. However the apps work with putty.

@shanselman
Copy link

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

@JBlond
Copy link
Author

JBlond commented Oct 21, 2015

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

@JBlond JBlond closed this as completed Oct 21, 2015
@shanselman
Copy link

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
Copy link
Author

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
Copy link

Thanks @JBlond

@trisk
Copy link

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
Copy link

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
Copy link

xcjs commented Oct 22, 2015

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

@robotdad
Copy link

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
Copy link
Contributor

Can you try these scenarios on the newer release?

@robotdad
Copy link

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
Copy link
Author

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
Copy link
Author

JBlond commented Nov 12, 2015

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

@manojampalam
Copy link
Contributor

Reactive if you still see any relevant issues

@thecliguy
Copy link

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?

@pseudovector
Copy link

@thecliguy @manojampalam I experienced the same.

@AllanOricil
Copy link

after connecting to my raspberry pi, I ran export TERM=ansi and then htop and it worked. My TERM env variable was set to msys, which htop does not support.

image

@nicholasp
Copy link

Is there any workaround this issue? I also can't make it work..

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

No branches or pull requests