Starting GUI application from mintty

187 views
Skip to first unread message

cam...@gmail.com

unread,
Dec 20, 2012, 9:33:53 AM12/20/12
to mintty-...@googlegroups.com
With both "mintty cmd" and "mintty bash" using the MinGW version of mintty, when I start "notepad" from within the console and then try to exit the console the window remains open. This is also true when "--hold never" is used. Is this expected behavior? Is there some kind of workaround?

Thanks,

David Sankel

Andrew Aylett

unread,
Dec 21, 2012, 3:14:29 PM12/21/12
to mintty-...@googlegroups.com
You can start the application using `cygstart`, which does much the same
thing as running the command (or document) from the Win-R dialog. Note
that it doesn't wait for the launched application to terminate. It's
very similar in net effect to the fdo command `xdg-open`.

- Andrew

Andy Koppe

unread,
Jan 4, 2013, 2:03:51 AM1/4/13
to mintty
On Dec 20 2012, 2:33 pm, cam...@gmail.com wrote:
> With both "mintty cmd" and "mintty bash" using the MinGW version of mintty,
> when I start "notepad" from within the console and then try to exit the
> console the window remains open. This is also true when "--hold never" is
> used. Is this expected behavior?

Yes. The mintty window remains open as long as there are still
processes connected to it.

Issue 319 asks for a change to this:
https://code.google.com/p/mintty/issues/detail?id=319

> Is there some kind of workaround?

If the deed is already done, just close the window with the close
button or Alt+F4 shortcut after exiting the shell.

On Cygwin, the 'setsid' utility from the util-linux package allows
invoking a process in its own session, i.e. without connection to
terminal it's invoked from. That doesn't appear to be available for
MSYS though.

'cygstart', as suggested by Andrew, is a good alternative, but again,
it's Cygwin only. On MSYS, that command has been renamed to just
'start' (for similarity with cmd.exe's start command).

Btw, you won't have much joy running 'mintty cmd', because cmd.exe
really expects to run in a Windows console. For example, basic things
such as the arrow keys won't work properly.

Andy
Reply all
Reply to author
Forward
0 new messages