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

"cygwin" terminal support #4

Closed
thejoshwolfe opened this issue Mar 18, 2011 · 6 comments
Closed

"cygwin" terminal support #4

thejoshwolfe opened this issue Mar 18, 2011 · 6 comments

Comments

@thejoshwolfe
Copy link

Steps to reproduce:

  1. From cygwin, ssh to a linux machine.
  2. ./keyboard
    tb_init() failed with error code -1

Note in this scenario $TERM == "cygwin".

@nsf
Copy link
Owner

nsf commented Mar 18, 2011

Can you please try: TERM=xterm ./keyboard

Most likely cygwin has compatible xterm termcap (like most terminals). And if it is that way, I will add it to the lib. On the other hand I'm not sure it will work on windows at all. But we'll see.

@thejoshwolfe
Copy link
Author

TERM=xterm made it work pretty well. None of the Ctrl+number combinations worked, although they were reported as overloads of other combinations (such as Ctrl+3 == Ctrl+[). I didn't test everything thoroughly, but it did run.

@thejoshwolfe
Copy link
Author

Another thing to note is that the terminal emulator in this scenario is truly cmd.exe, not anything made by cygwin. I'm guessing cygwin defines the TERM variable because unix expects it, but cygwin actually has no idea what terminal emulator it's running in. When running cygwin's bash inside an alternative terminal emulator for windows called Console 2, $TERM is still "cygwin". That makes "cygwin" as a $TERM value effectively unreliable, but it still seems prudent to assume "cygwin" means cmd.exe.

@nsf
Copy link
Owner

nsf commented Mar 22, 2011

None of Ctrl+number are supported. See NOTES file for partial explanation. I'll add "cygwin" terminal type now as an xterm compatible terminal.

@thejoshwolfe
Copy link
Author

more things that don't line up in cygwin:
F1 is 'A'
F2 is 'B'
F3 is 'C'
F4 is 'D'
F5 is 'E'
up arrow is 'A'
down arrow is 'B'
right arrow is 'C'
left arrow is 'D'
home is ''
end is '
'

The following:
F6-F12, page up, page down, insert, delete
intermittently register as ''. Intermittently as in, keep pressing F7 repeatedly and it will switch between F7 and '' erratically. It looks like this is all the "Key" inputs as opposed to the "Char" inputs except for escape, tab, and backspace. Those 3 are reliable.

This behavior is identical in both cmd.exe and Console 2.

@nsf
Copy link
Owner

nsf commented Mar 22, 2011

So it's not xterm compatible, I'll see what I can do, but it may take some time..

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

No branches or pull requests

2 participants