public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin/X - Query: why invoking from cmd backgrounds?
@ 2024-01-20  8:55 Shaddy Baddah
  2024-01-20 15:08 ` Marco Atzeri
  2024-01-20 15:46 ` Jon Turney
  0 siblings, 2 replies; 3+ messages in thread
From: Shaddy Baddah @ 2024-01-20  8:55 UTC (permalink / raw)
  To: cygwin

Hi,

I am just wondering if anyone understands why XWin detaches/runs in
the background, when launched from Windows Command Prompt.

This being different to when run from Mintty.

Here's what happens with my Mintty invocation, which stays in the
foreground:

| $ XWin  :1 -nolisten tcp -ac -multiwindow
| Welcome to the XWin X Server
| Vendor: The Cygwin/X Project
| Release: 1.21.1.9
| OS: CYGWIN_NT-10.0-19045 pc-w10 3.4.10-1.x86_64 2023-11-29 12:12 UTC x86_64
| OS: Windows 10  [Windows NT 10.0 build 19045] x64
| Package: version 21.1.9-1 built 2023-12-10
|
| XWin was started with the following command line:
|
| XWin :1 -nolisten tcp -ac -multiwindow
|
| (II) xorg.conf is not supported
| (II) See http://x.cygwin.com/docs/faq/cygwin-x-faq.html for more information
| winUpdateDpi - primary monitor native DPI x 96 y 96
...
| winClipboardProc - xcb_connect () returned and successfully opened the display.


Here's what happens if I invoke tigervnc-server from Windows Command
Prompt, where it stays in the forgeground and I can terminate with
Ctrl-C:

| C:\Users\shaddy>C:\PublicData\sw.portapps\cygwin.x86_64\bin\Xvnc  :2 -nolisten tcp -ac -geometry 900x600 -SecurityTypes=None
|
| Xvnc TigerVNC 1.8.0 - built Dec 30 2017 22:15:31
| Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)
| See http://www.tigervnc.org for information on TigerVNC.
| Underlying X server release 11906000, The X.Org Foundation
|
|
| Sat Jan 20 19:34:43 2024
|  vncext:      VNC extension running!
|  vncext:      Listening for VNC connections on all interface(s), port 5902
|  vncext:      created VNC server for screen 0
| MIT-SHM extension disabled due to lack of kernel support

But here's what happens when I run that first command line from
Windows Command Prompt. No output and the command returns, though the
server is running (including with an icon tray clickable):

| C:\Users\shaddy>C:\PublicData\sw.portapps\cygwin.x86_64\bin\XWin :1 -nolisten tcp -ac -multiwindow
|
| C:\Users\shaddy>

Is this special detection and handling in the main() (or whatever
entrypoint is applicable)?

--
Regards,
Shaddy


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

* Re: Cygwin/X - Query: why invoking from cmd backgrounds?
  2024-01-20  8:55 Cygwin/X - Query: why invoking from cmd backgrounds? Shaddy Baddah
@ 2024-01-20 15:08 ` Marco Atzeri
  2024-01-20 15:46 ` Jon Turney
  1 sibling, 0 replies; 3+ messages in thread
From: Marco Atzeri @ 2024-01-20 15:08 UTC (permalink / raw)
  To: cygwin

On 20/01/2024 09:55, Shaddy Baddah via Cygwin wrote:
> Hi,
> 
> I am just wondering if anyone understands why XWin detaches/runs in
> the background, when launched from Windows Command Prompt.

Hi Shaddy,
Only a guess

> But here's what happens when I run that first command line from
> Windows Command Prompt. No output and the command returns, though the
> server is running (including with an icon tray clickable):
> 
> | C:\Users\shaddy>C:\PublicData\sw.portapps\cygwin.x86_64\bin\XWin :1 
> -nolisten tcp -ac -multiwindow
> |
> | C:\Users\shaddy>
> 
> Is this special detection and handling in the main() (or whatever
> entrypoint is applicable)?

I assume you still have the log on /var/log/xwin/XWin.0.log
but it is not anymore duplicated on the terminal


> Regards,
> Shaddy

Marco


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

* Re: Cygwin/X - Query: why invoking from cmd backgrounds?
  2024-01-20  8:55 Cygwin/X - Query: why invoking from cmd backgrounds? Shaddy Baddah
  2024-01-20 15:08 ` Marco Atzeri
@ 2024-01-20 15:46 ` Jon Turney
  1 sibling, 0 replies; 3+ messages in thread
From: Jon Turney @ 2024-01-20 15:46 UTC (permalink / raw)
  To: Shaddy Baddah; +Cc: cygwin

On 20/01/2024 08:55, Shaddy Baddah via Cygwin wrote:
> Hi,
> 
> I am just wondering if anyone understands why XWin detaches/runs in
> the background, when launched from Windows Command Prompt.

I assume this is due to XWin being marked as a GUI, not console 
application (to stop it popping up a useless console window when run 
directly e.g. via explorer or a shortcut).

> This being different to when run from Mintty.
> 
> Here's what happens with my Mintty invocation, which stays in the
[...]
> 
> Is this special detection and handling in the main() (or whatever
> entrypoint is applicable)?

This is something cmd (and powershell) does. I don't know the mechanism.

I think you can make cmd wait with 'start /w'.  Or maybe making the 
command part of a pipeline...


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

end of thread, other threads:[~2024-01-20 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-20  8:55 Cygwin/X - Query: why invoking from cmd backgrounds? Shaddy Baddah
2024-01-20 15:08 ` Marco Atzeri
2024-01-20 15:46 ` Jon Turney

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).