Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-16 Thread Brian Inglis
On 2020-05-15 22:58, Takashi Yano via Cygwin wrote:
> On Fri, 15 May 2020 14:57:14 -0600
> Brian Inglis wrote:
>>> cygcheck -k
>>
>> This key check works only in a console window, _NOT_ in a terminal session!
>> Abort with Ctrl+C if in a terminal session.
> 
> Now cygcheck -k works in pty in a limited way due to pseudo
> console support if the OS is Win10 1809 or later.

But the results are not comparable: under mintty q gives:

$ cygcheck -k

This key check works only in a console window, _NOT_ in a terminal session!
Abort with Ctrl+C if in a terminal session.

Press 'q' to exit.
Pressed  1x VK: 0x0048 VS: 0x0023 C: 0x0008 CTRL: -- -- -- LC -- -- -- -- --
Released 1x VK: 0x0048 VS: 0x0023 C: 0x0008 CTRL: -- -- -- LC -- -- -- -- --
Released 1x VK: 0x0011 VS: 0x001d C: 0x CTRL: -- -- -- -- -- -- -- -- --
Pressed  1x VK: 0x0051 VS: 0x003c C: 0x0071 CTRL: -- -- -- -- -- -- -- -- --
Released 1x VK: 0x0051 VS: 0x003c C: 0x0071 CTRL: -- -- -- -- -- -- -- -- --

whereas under cmd we see:

 > cygcheck -k

This key check works only in a console window, _NOT_ in a terminal session!
Abort with Ctrl+C if in a terminal session.

Press 'q' to exit.
Released 1x VK: 0x0008 VS: 0x000e C: 0x0008 CTRL: -- -- -- -- NL -- -- -- --
Pressed  1x VK: 0x0051 VS: 0x0010 C: 0x0071 CTRL: -- -- -- -- NL -- -- -- --
Released 1x VK: 0x0051 VS: 0x0010 C: 0x0071 CTRL: -- -- -- -- NL -- -- -- --

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-15 Thread Takashi Yano via Cygwin
On Fri, 15 May 2020 14:57:14 -0600
Brian Inglis wrote:
> >cygcheck -k
> 
> This key check works only in a console window, _NOT_ in a terminal session!
> Abort with Ctrl+C if in a terminal session.

Now cygcheck -k works in pty in a limited way due to pseudo
console support if the OS is Win10 1809 or later.

-- 
Takashi Yano 
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-15 Thread Brian Inglis
On 2020-05-14 17:47, Takashi Yano via Cygwin wrote:
> On Thu, 14 May 2020 19:48:59 +0200
> Kacper Michajlow wrote:
>> On Thu, 14 May 2020 at 05:33, Takashi Yano  wrote:
>>
>>> I guess setting
>>> stty erase '^?'
>>> on the host  resolves this problem.
>>>
>>
>> Nope, it still doesn't work. And '^?' default so it doesn't change
>> anything. Please note that in bash Backspace works fine, but in read
>> command (or any other program that ask input from stdin) it fails.
> 
> Please check the result of
> xxd
> Ctrl-V Backspace Enter Ctrl-D

As xxd is an optional package, and od is in base coreutils package, you may want
to suggest e.g.

$ od -atx1
 [four key entries]

and please post the output.

Alternatively cygcheck -k is intended for testing console key codes under cmd,
and if that could be helpful, ask for cmd to be run, then in that console
session, type:

> cygcheck -k
q [two key entries]

and please post the output e.g.

>cygcheck -k

This key check works only in a console window, _NOT_ in a terminal session!
Abort with Ctrl+C if in a terminal session.

Press 'q' to exit.
Released 1x VK: 0x0008 VS: 0x000e C: 0x0008 CTRL: -- -- -- -- NL -- -- -- --
Pressed  1x VK: 0x0051 VS: 0x0010 C: 0x0071 CTRL: -- -- -- -- NL -- -- -- --
Released 1x VK: 0x0051 VS: 0x0010 C: 0x0071 CTRL: -- -- -- -- NL -- -- -- --

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-15 Thread Kacper Michajlow via Cygwin
On Fri, 15 May 2020 at 13:45, Takashi Yano  wrote:

> ...
> Then,
> stty echoe echok echoctl echoke
> should solve the problem.
>

Indeed, but I got confused, because it does work fine in local session and
it also has -echoe -echok -echoctl -echoke... What is the difference? I'm
just curious at this point.


> This causes because cygwin does not set ECHOE, ECHOK, ECHOCTL and ECHOKE
> by default. Mintty sets them by itself. Tcsh seems also to set them.
> However, bash does not.
>

FWIW, zsh also does not set those.

Thanks for help and patience :)

- Kacper
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-15 Thread Takashi Yano via Cygwin
On Fri, 15 May 2020 11:34:33 +0200
Kacper Michajlow wrote:
> Windows Terminal:
> 
> $ echo $TERM
> xterm-256color
> $ stty
> speed 38400 baud; line = 0;
> eol = M-^?; eol2 = M-^?;
> -brkint -imaxbel iutf8
> -echoe -echok -echoctl -echoke
...
> Mintty:
> 
> $ echo $TERM
> xterm-256color
> $ stty
> speed 38400 baud; line = 0;
> eol = M-^?; eol2 = M-^?;
> -brkint ixany iutf8

Then,
stty echoe echok echoctl echoke
should solve the problem.

This causes because cygwin does not set ECHOE, ECHOK, ECHOCTL and ECHOKE
by default. Mintty sets them by itself. Tcsh seems also to set them.
However, bash does not.

Could someone please tell me whether cygwin should set them by default?

-- 
Takashi Yano 
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-15 Thread Kacper Michajlow via Cygwin
On Fri, 15 May 2020 at 01:47, Takashi Yano  wrote:

> Please check the result of
> xxd
> Ctrl-V Backspace Enter Ctrl-D
>


Here is comparison with running ssh connection to the same machine in WT
and Mintty. Also I noticed that selecting and copying multi-line output of
stty in Windows Terminal was missing new line and was filled with spaces to
the end on terminal window.

Windows Terminal:

$ echo $TERM
xterm-256color
$ stty
speed 38400 baud; line = 0;
eol = M-^?; eol2 = M-^?;
-brkint -imaxbel iutf8
-echoe -echok -echoctl -echoke
$ xxd
⌂
: 7f0a ..
$ stty -a
speed 38400 baud; rows 38; columns 139; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 =
M-^?; swtch = ; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon
-ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
isig icanon iexten echo -echoe -echok -echonl -noflsh -xcase -tostop
-echoprt -echoctl -echoke -flusho -extproc

Mintty:

$ echo $TERM
xterm-256color
$ stty
speed 38400 baud; line = 0;
eol = M-^?; eol2 = M-^?;
-brkint ixany iutf8
$ xxd
^?
: 7f0a ..
$ stty -a
speed 38400 baud; rows 41; columns 135; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 =
M-^?; swtch = ; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon
-ixoff -iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc

--
In local session, both Mintty and WT in xxd test produce:
: 0a

- Kacper
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-14 Thread Takashi Yano via Cygwin
On Thu, 14 May 2020 19:48:59 +0200
Kacper Michajlow wrote:
> On Thu, 14 May 2020 at 05:33, Takashi Yano  wrote:
> 
> > I guess setting
> > stty erase '^?'
> > on the host  resolves this problem.
> >
> 
> Nope, it still doesn't work. And '^?' default so it doesn't change
> anything. Please note that in bash Backspace works fine, but in read
> command (or any other program that ask input from stdin) it fails.

Please check the result of
xxd
Ctrl-V Backspace Enter Ctrl-D

-- 
Takashi Yano 
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-14 Thread Kacper Michajlow via Cygwin
On Thu, 14 May 2020 at 05:33, Takashi Yano  wrote:

> I guess setting
> stty erase '^?'
> on the host  resolves this problem.
>

Nope, it still doesn't work. And '^?' default so it doesn't change
anything. Please note that in bash Backspace works fine, but in read
command (or any other program that ask input from stdin) it fails.
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-13 Thread Takashi Yano via Cygwin
On Thu, 14 May 2020 01:15:55 +0200
Kacper Michajlow  wrote:

> On Wed, 13 May 2020 at 12:34, Takashi Yano  wrote:
> 
> > What do you mean by "Microsoft Terminal"? Also, do you use cygwin vim?
> > If you mean "Windows Terminal" and cygwin vim, I cannot reproduce your
> > problem. Arrow keys are working correctly in vim with Windows Terminal
> > as well as with console (command prompt)
> 
> 
> Of course, I meant Windows Terminal, silly mistake :)
> 
> Also I am sorry for not checking it thoroughly enough. Because while it
> broke by updating Cygwin, actually updating WT to latest version fixed most
> of my problems. I have not tested it much yet, but only one issue remains.
> 
> When something ask for user input, Backspace doesn't work in remote ssh
> session.
> 
> STR:
> 1. ssh 
> 2. Run read command
> 3. You can type, but trying to erase char with Backspace key will print ⌂
> instead.
> 
> This happens only in remote ssh session in WT using Cygwin's ssh. Works
> fine using Native Window's OpenSSH client or in local Cygwin session. Also
> works fine when using mintty or WSL for that matter...
> 
> I don't know who is to blame here, WT or Cygwin?

I guess setting
stty erase '^?'
on the host  resolves this problem.

-- 
Takashi Yano 
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-13 Thread Takashi Yano via Cygwin
On Tue, 12 May 2020 22:26:07 +0200
Kacper Michajlow via Cygwin  wrote:
> I was testing latest master (e637d53) and console is clunky in anything
> that isn't cmd.exe or mintty. I tested Microsoft Terminal and ConEmu.
> 
> For example navigating with arrows doesn't work in vim. In zsh searching
> history with up arrow when there is beginning of the command doesn't work.
> And so on, sometimes Home button doesn't work to jump to beginning of the
> line or Backspace to clear input.

As for ConEmu, please use cygwin-connector.
https://conemu.github.io/en/CygwinMsysConnector.html

What do you mean by "Microsoft Terminal"? Also, do you use cygwin vim?
If you mean "Windows Terminal" and cygwin vim, I cannot reproduce your
problem. Arrow keys are working correctly in vim with Windows Terminal
as well as with console (command prompt).

> It used to work better. I have tried CYGWIN=disable_pcon but didn't help
> really.

disable_pcon does not affect cygwin console behaviour. It is for pty.

-- 
Takashi Yano 
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Console doesn't work correctly under anything else than cmd or mintty

2020-05-13 Thread Eric Lilja via Cygwin
I had a similar experience when I tried to use the CLI that comes with
MongoDB. Switched to use TakeCommand instead when I needed to use the
MongoDB CLI. Too bad!

- Eric L

On Tue, May 12, 2020 at 11:05 PM Kacper Michajlow via Cygwin <
cygwin@cygwin.com> wrote:

> Hi,
>
> I was testing latest master (e637d53) and console is clunky in anything
> that isn't cmd.exe or mintty. I tested Microsoft Terminal and ConEmu.
>
> For example navigating with arrows doesn't work in vim. In zsh searching
> history with up arrow when there is beginning of the command doesn't work.
> And so on, sometimes Home button doesn't work to jump to beginning of the
> line or Backspace to clear input.
>
> It used to work better. I have tried CYGWIN=disable_pcon but didn't help
> really.
>
> Is it known problem? Is there a workaround? Should this be fixed in Cygwin
> or somewhere else?
>
> Thanks,
> Kacper
> --
> Problem reports:  https://cygwin.com/problems.html
> FAQ:  https://cygwin.com/faq/
> Documentation:https://cygwin.com/docs.html
> Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
>
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Console doesn't work correctly under anything else than cmd or mintty

2020-05-12 Thread Kacper Michajlow via Cygwin
Hi,

I was testing latest master (e637d53) and console is clunky in anything
that isn't cmd.exe or mintty. I tested Microsoft Terminal and ConEmu.

For example navigating with arrows doesn't work in vim. In zsh searching
history with up arrow when there is beginning of the command doesn't work.
And so on, sometimes Home button doesn't work to jump to beginning of the
line or Backspace to clear input.

It used to work better. I have tried CYGWIN=disable_pcon but didn't help
really.

Is it known problem? Is there a workaround? Should this be fixed in Cygwin
or somewhere else?

Thanks,
Kacper
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple