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

Pressing Up while a program is running moves the cursor up #630

Closed
orgads opened this Issue Feb 13, 2017 · 10 comments

Comments

Projects
None yet
3 participants
@orgads
Copy link

orgads commented Feb 13, 2017

Then the output of the running program overwrites previous lines.

On Linux bash, pressing Up writes ^[[A, leaving the cursor on the same line.

@mintty

This comment has been minimized.

Copy link
Owner

mintty commented Feb 13, 2017

Which program?
Your report is very sparse. Needing to close. Anyway, it's certainly a duplicate of many reports about Windows console/Cygwin pty incompatibility, all grounding to #56.

@mintty mintty closed this Feb 13, 2017

@mintty

This comment has been minimized.

Copy link
Owner

mintty commented Feb 13, 2017

particularly duplicate of #556 in this case

@elieux

This comment has been minimized.

Copy link

elieux commented Feb 13, 2017

@mintty, I verified that even in Cygwin/MSYS2 cat MinTTY behaves this way while PuTTY and Linux terminals/emulators do not. I'm still not 100 % sure it's MinTTY's fault, but even in case it's not, I would be glad if you could provide your expertise to help diagnose the problem.

@mintty

This comment has been minimized.

Copy link
Owner

mintty commented Feb 13, 2017

Sure I will, but a reproducible description of a problem is always a good starter, in general.
As you mention cat, it seems you mean any program. Well, except those that explicitly interpret cursor key sequences. And it's not one of the issues I referred before.
It's not a mintty issue either, to state that right away. You have the same behaviour in xterm and also Cygwin console; these are always good cross-checks for all kinds of keyboard-related issues.

It's likely different handling of "cooked mode" keyboard input by the readline library, compared with typical Linux/Unix systems. I remember it's been discussed somewhere...
You can test that the keys are actually processed normally, e.g. with cat > test, then enter some cursor keys. They are written to the output as expected, and they are echoed literally, rather than escaped on some other systems. Why that's different is beyond my knowledge.

@orgads

This comment has been minimized.

Copy link
Author

orgads commented Feb 13, 2017

Here is an example:
MinTTY arrows

Cygwin doesn't allow movement while a process is running, but it also moves on cat, which accepts input:
Cygwin arrows

@elieux

This comment has been minimized.

Copy link

elieux commented Feb 13, 2017

You're right, I should've tried other Cygwin emulators first.

  1. I'm discussing the cat thing in #cygwin, so far no definitive answer, but it seems to be in Cygwin's tty.

  2. The sleep thing seems to be in MinTTY.

@mintty

This comment has been minimized.

Copy link
Owner

mintty commented Feb 13, 2017

The "sleep thing" isn't a mintty issue either. You're right, it's different in Cygwin console (probably related to the fact that is doesn't use pty as mintty does), but it's the same in xterm.

@elieux

This comment has been minimized.

Copy link

elieux commented Feb 13, 2017

Seems like cat here sees the same in both scenarios, just the things that appear on terminal are different. Possibly interesting is that while PuTTY copies the Linux behavior, ssh'ing from MSYS2 to a Linux keeps the MSYS2/Cygwin behavior.

@mintty

This comment has been minimized.

Copy link
Owner

mintty commented Feb 13, 2017

Is that MSYS putty or Windows putty?
Does anything change if you vary the putty Terminal – Line discipline options?

@elieux

This comment has been minimized.

Copy link

elieux commented Feb 14, 2017

It's Win32 PuTTY.

when I press an arrow key Local editing on Local editing off
Local echo on writes ^[[X cursor moves and then writes ^[[X
Local echo off nothing happens writes ^[[X

... where ^[[X is one of ^[[A, ^[[B, ^[[C, ^[[D.

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