* Starting xterm as a DOS Command Prompt one-liner
@ 2020-11-26 9:08 Fergus Daly
2020-11-28 14:14 ` Fergus Daly
0 siblings, 1 reply; 2+ messages in thread
From: Fergus Daly @ 2020-11-26 9:08 UTC (permalink / raw)
To: 'cygwin@cygwin.com'
This one-line DOS command to start an xterm terminal:
D:\cygwin> bin\run bin\XWin -clipboard -nolock -multiwindow 2> nul &
timeout 4 > nul 2> nul &
bin\xterm -display :0.0 2> nul &
bin\kill -KILL -- -1
(broken here after each "&" for clarity of presentation only) works, and is a
neat and convenient alternative to starting xterm at the bash or mintty prompt
with the single line
$ /bin/xinit /bin/xterm -- -nolock -multiwindow 2> /dev/null
(The "> nul" phrases in all the above just suppress notifications.)
Question 1:
I find the timeout .. chunk necessary to give XWin enough time to load
before the xterm .. chunk draws upon it.
Is there a different conjunction to "&" that says "wait till this is
enacted before moving on" (which is actually what I thought "&" did!)?
Question 2:
The final kill .. chunk only operates after the xterm terminal is closed,
and its purpose is to kill XWin, which otherwise hangs about.
Is there some other way of assuring that the un-needed XWin is killed,
maybe (I dunno) by adding a qualifier to the initial "run XWin" chunk?
Thank you!
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: Starting xterm as a DOS Command Prompt one-liner
2020-11-26 9:08 Starting xterm as a DOS Command Prompt one-liner Fergus Daly
@ 2020-11-28 14:14 ` Fergus Daly
0 siblings, 0 replies; 2+ messages in thread
From: Fergus Daly @ 2020-11-28 14:14 UTC (permalink / raw)
To: 'cygwin@cygwin.com'
> This one-line DOS command to start an xterm terminal:
> D:\cygwin> bin\run bin\XWin -clipboard -nolock -multiwindow 2> nul &
> timeout 4 > nul 2> nul &
> bin\xterm -display :0.0 2> nul &
> bin\kill -KILL -- -1
> (broken here after each "&" for clarity of presentation only) works, ..
As a trivial postscript: starting xterm from Windows with the single line
above is as frugal a start-up as any I have come across: ps gives
PID PPID PGID WINPID TTY UID STIME COMMAND
1122 1121 1122 7232 pty0 197609 13:57:34 /usr/bin/ps
1120 1 1120 12216 cons0 197609 13:57:32 /usr/bin/xterm
1115 1 1115 11964 ? 197609 13:57:30 /usr/bin/XWin
1121 1120 1121 4228 pty0 197609 13:57:32 /usr/bin/bash
i.e. just 1 x bash + 1 x XWin + 1 x xterm.
Even the one-line xterm startup
$ xinit xterm -- -nolock -multiwindow
from a bash shell, recently shared here, gives the somewhat lengthy
PID PPID PGID WINPID TTY UID STIME COMMAND
1745 1739 1745 3548 ? 197609 14:01:42 /usr/bin/xterm
1740 1739 1740 6564 cons0 197609 14:01:41 /usr/bin/XWin
1737 1 1737 10976 cons0 197609 13:59:39 /usr/bin/bash
1739 1737 1739 12004 cons0 197609 14:01:41 /usr/bin/xinit
1748 1747 1748 6800 pty1 197609 14:01:44 /usr/bin/ps
1746 1745 1746 10316 pty0 197609 14:01:42 /usr/bin/xterm
1747 1746 1747 8820 pty1 197609 14:01:42 /usr/bin/bash
i.e. 2 x bash + 1 x xinit + 1 x XWin + 2 x xterm.
BTW the switch -clipboard is redundant in the proffered line above, its omission
rendering the sequence shorter still.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-28 14:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 9:08 Starting xterm as a DOS Command Prompt one-liner Fergus Daly
2020-11-28 14:14 ` Fergus Daly
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).