public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Can't start a cygwin terminal(mintty) as admin
       [not found] <938348063.536233005.1606213898648.JavaMail.root@zimbra93-e16.priv.proxad.net>
@ 2020-11-24 12:51 ` akikij
  2020-11-24 20:22   ` Kevin Schnitzius
  2020-11-24 23:17   ` Takashi Yano
  0 siblings, 2 replies; 8+ messages in thread
From: akikij @ 2020-11-24 12:51 UTC (permalink / raw)
  To: cygwin


From some months, use of a terminal with cygwin is changing and changing but for me with more and more difficult to use.

Prior to 3.1 version of the cygwin package, I could use two kinds of terminals bash and mintty.
I like the bash version because I can launch with it an admin session, simply in telling to shortcut "exec as admin".

But with the pty support provided by the new cygwin package, the bash terminal behavior has changed, relatively to Ctrl-C support.

I have a curses application to launch bash scripts applications through a MMI interface presenting several choices of them.

Before 3.1, for mintty and bash terminals, on a ctrl-C, my application MMI and bash script were stopped cleanly.

But now for a bash terminal, a Ctrl-C quits the curses application in leaving the shell script to continue in background.
To day, I don't know how write one C application with ncurses being compatible with bash and mintty terminals as yesterday.

QUESTION 1 : HOW TO NOW HANDLE CTRL-C in a multi threaded cygwin application regarless of terminal

As I am obliged to use mintty, now I can't launch a mintty terminal session as admin, I don't understand why.

QUESTION 2 : HOW TO LAUNCH A MINTTY SESSION AS ADMIN

My questions with last package versions (or not) for cygwin and mintty.

Thanks for your help




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Can't start a cygwin terminal(mintty) as admin
  2020-11-24 12:51 ` Can't start a cygwin terminal(mintty) as admin akikij
@ 2020-11-24 20:22   ` Kevin Schnitzius
  2020-11-24 20:59     ` Thomas Wolff
  2020-11-24 23:17   ` Takashi Yano
  1 sibling, 1 reply; 8+ messages in thread
From: Kevin Schnitzius @ 2020-11-24 20:22 UTC (permalink / raw)
  To: cygwin, akikij

On Tuesday, November 24, 2020, 07:52:11 AM EST, akikij@free.fr <akikij@free.fr> wrote:

> QUESTION 1 : HOW TO NOW HANDLE CTRL-C in a multi threaded cygwin application regarless of terminal
Ctrl-c is broken on mintty.  I use this:
    D:\cygwin64\bin\mintty.exe -o "KeyFunctions=A+F5:break" -

And use alt-F5 as a break that works on both Cygwin and non-Cygwin processes.
> QUESTION 2 : HOW TO LAUNCH A MINTTY SESSION AS ADMIN

cygstart --action=runas mintty.exe

Kevin 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Can't start a cygwin terminal(mintty) as admin
  2020-11-24 20:22   ` Kevin Schnitzius
@ 2020-11-24 20:59     ` Thomas Wolff
  2020-11-25  7:43       ` Kevin Schnitzius
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Wolff @ 2020-11-24 20:59 UTC (permalink / raw)
  To: cygwin

Am 24.11.2020 um 21:22 schrieb Kevin Schnitzius via Cygwin:
> On Tuesday, November 24, 2020, 07:52:11 AM EST, akikij@free.fr <akikij@free.fr> wrote:
>
>>   QUESTION 1 : HOW TO NOW HANDLE CTRL-C in a multi threaded cygwin application regarless of terminal
> Ctrl-c is broken on mintty.
This is a wrong statement. For a terminal, Ctrl+c is just a control 
character, nothing else. It's the pty device, shell or application that 
may, or may not, associate it with specific handling like interruption.

>    I use this:
>      D:\cygwin64\bin\mintty.exe -o "KeyFunctions=A+F5:break" -
>
> And use alt-F5 as a break that works on both Cygwin and non-Cygwin processes.
>> QUESTION 2 : HOW TO LAUNCH A MINTTY SESSION AS ADMIN
> cygstart --action=runas mintty.exe
>
> Kevin
>
> --
> 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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Can't start a cygwin terminal(mintty) as admin
  2020-11-24 12:51 ` Can't start a cygwin terminal(mintty) as admin akikij
  2020-11-24 20:22   ` Kevin Schnitzius
@ 2020-11-24 23:17   ` Takashi Yano
  1 sibling, 0 replies; 8+ messages in thread
From: Takashi Yano @ 2020-11-24 23:17 UTC (permalink / raw)
  To: cygwin

On Tue, 24 Nov 2020 13:51:59 +0100 (CET)
> QUESTION 1 : HOW TO NOW HANDLE CTRL-C in a multi threaded cygwin application regarless of terminal

Could you provide simple test case which can reproduce your problem?

> QUESTION 2 : HOW TO LAUNCH A MINTTY SESSION AS ADMIN

In my environment, "Run as administrator" menu on mouse-right-click
works.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Can't start a cygwin terminal(mintty) as admin
  2020-11-24 20:59     ` Thomas Wolff
@ 2020-11-25  7:43       ` Kevin Schnitzius
  2020-11-25  8:44         ` Thomas Wolff
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Schnitzius @ 2020-11-25  7:43 UTC (permalink / raw)
  To: cygwin, Thomas Wolff

On Tuesday, November 24, 2020, 03:59:19 PM EST, Thomas Wolff <towo@towo.net> wrote:
 
 Am 24.11.2020 um 21:22 schrieb Kevin Schnitzius via Cygwin:
>> Ctrl-c is broken on mintty.
> This is a wrong statement. For a terminal, Ctrl+c is just a control 
> character, nothing else. It's the pty device, shell or application that 
> may, or may not, associate it with specific handling like interruption.

D:\cygwin64\bin\mintty.exe -o "KeyFunctions=A+F5:break" -
alt-F5 is a break that works on both Cygwin and non-Cygwin processes.

D:\cygwin64\bin\mintty.exe -o "KeyFunctions=C+c:break" -
Ctrl-c is a break that works on Cygwin processes only.
This C+c used to work in both cases...  I think we've been over this before andthe problem very well may be in the pty break handling.
Kevin
  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Can't start a cygwin terminal(mintty) as admin
  2020-11-25  7:43       ` Kevin Schnitzius
@ 2020-11-25  8:44         ` Thomas Wolff
  2020-11-28  3:13           ` Kevin Schnitzius
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Wolff @ 2020-11-25  8:44 UTC (permalink / raw)
  To: Kevin Schnitzius, cygwin



Am 25.11.2020 um 08:43 schrieb Kevin Schnitzius:
> On Tuesday, November 24, 2020, 03:59:19 PM EST, Thomas Wolff 
> <towo@towo.net> wrote:
>
> Am 24.11.2020 um 21:22 schrieb Kevin Schnitzius via Cygwin:
> >> Ctrl-c is broken on mintty.
> > This is a wrong statement. For a terminal, Ctrl+c is just a control
> > character, nothing else. It's the pty device, shell or application that
> > may, or may not, associate it with specific handling like interruption.
>
> D:\cygwin64\bin\mintty.exe -o "KeyFunctions=A+F5:break" -
> alt-F5 is a break that works on both Cygwin and non-Cygwin processes.
>
> D:\cygwin64\bin\mintty.exe -o "KeyFunctions=C+c:break" -
> Ctrl-c is a break that works on Cygwin processes only.
That configuration would assign the break function to Shift+Ctrl+c, not 
just Ctrl+c, so with Ctrl+c you still just send a ^C character while in 
the other case mintty would invoke a BRK signal. So try Shift+Ctrl+c.

>
> This C+c used to work in both cases...  I think we've been over this 
> before and
> the problem very well may be in the pty break handling.
>
> Kevin
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Can't start a cygwin terminal(mintty) as admin
  2020-11-25  8:44         ` Thomas Wolff
@ 2020-11-28  3:13           ` Kevin Schnitzius
  2020-11-28  4:28             ` Thomas Wolff
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Schnitzius @ 2020-11-28  3:13 UTC (permalink / raw)
  To: cygwin, Thomas Wolff

On Wednesday, November 25, 2020, 03:44:30 AM EST, Thomas Wolff <towo@towo.net> wrote:
>> D:\cygwin64\bin\mintty.exe -o "KeyFunctions=C+c:break" -
>> Ctrl-c is a break that works on Cygwin processes only.
> That configuration would assign the break function to Shift+Ctrl+c, not just Ctrl+c, so with Ctrl+c you still just > send a ^C character while in the other case mintty would invoke a BRK signal. So try Shift+Ctrl+c.
Oops, it's been a while since I looked into it.
D:\cygwin64\bin\mintty.exe -o "KeyFunctions=C+c:break" 
Shift+Ctrl+c does not produce a break for Cygwin or non-Cygwin processes
mintty -o "KeyFunctions=c:break" -o CtrlExchangeShift=true
Actually, this restores the old behavior of Ctrl+c actually doing a break for Cygwin and non-Cygwin processes.
Kevin 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Can't start a cygwin terminal(mintty) as admin
  2020-11-28  3:13           ` Kevin Schnitzius
@ 2020-11-28  4:28             ` Thomas Wolff
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Wolff @ 2020-11-28  4:28 UTC (permalink / raw)
  To: Kevin Schnitzius, cygwin



Am 28.11.2020 um 04:13 schrieb Kevin Schnitzius:
> On Wednesday, November 25, 2020, 03:44:30 AM EST, Thomas Wolff 
> <towo@towo.net> wrote:
>
> >> D:\cygwin64\bin\mintty.exe -o "KeyFunctions=C+c:break" -
> >> Ctrl-c is a break that works on Cygwin processes only.
>
> > That configuration would assign the break function to Shift+Ctrl+c, not 
> just Ctrl+c, so with Ctrl+c you still just
> > send a ^C character while in the other case mintty would invoke a BRK 
> signal. So try Shift+Ctrl+c.
>
> Oops, it's been a while since I looked into it.
>
> D:\cygwin64\bin\mintty.exe -o "KeyFunctions=C+c:break"
> Shift+Ctrl+c does not produce a break for Cygwin or non-Cygwin processes
>
Works for me. Your child process may have disabled the SIGINT signal.
> mintty -o "KeyFunctions=c:break" -o CtrlExchangeShift=true
> Actually, this restores the old behavior of Ctrl+c actually doing a 
> break for Cygwin and non-Cygwin processes.
>
> Kevin
>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-11-28  4:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <938348063.536233005.1606213898648.JavaMail.root@zimbra93-e16.priv.proxad.net>
2020-11-24 12:51 ` Can't start a cygwin terminal(mintty) as admin akikij
2020-11-24 20:22   ` Kevin Schnitzius
2020-11-24 20:59     ` Thomas Wolff
2020-11-25  7:43       ` Kevin Schnitzius
2020-11-25  8:44         ` Thomas Wolff
2020-11-28  3:13           ` Kevin Schnitzius
2020-11-28  4:28             ` Thomas Wolff
2020-11-24 23:17   ` Takashi Yano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).