meaning, a connection and wts session is started but one does not need
to provide a initial application to be run at start.
To clarify this, with the new "seameless connection sharing" functionality, one should be able to start rdesktop with the shell seamlessshellrdp.exe without providing a program to spawn. This would make the rdesktop process just establishing a connection, logon then do nothing waiting for a new rdesktop to spawn a program in the already established connection.
The approach will be to add an argument /D for daemon mode which will accept to start seamlessrdpshell without a specific commandline. I daemon mode the shutdown of semlessrdpshell differs from normal mode were seamlesrdpshell exits when last spawn application is closed.
In daemon mode it will exits under the following circumstances, if WTS session is disconnected and there are no applications running within a timeframe it will exits and the WTS session will logout.
The timeout here should be configurable /T:X where X is timeout specified in seconds, a timeout with 0 value should disable the timeout functionality and the WTS session will be active as long its configured to lived on the WTS side.
Without /T specified a proper default timeout value should be used probably something like 60 seconds.
There is one problem with the previous approach due to a WTS session is matched
using the shell for connection so it is not possible to reconnect to a disconnected WTS session if shell differs. A new approach has been discussed.
Always and only use "seamlessshellrdp.exe" without arguments as shell and provide an additional cmdline argument to rdesktop to provide a command to be spawned using the new seamless spawn extension of seamless RDP protocol.
Something in line with:
rdesktop -A -s "c:\\seamlesrdp\\seamlessrdpshell.exe" mywts.domain.com --seamless-spawn="notepad.exe"
We also need to rework the session lifetime for seamlessrdp, one rule is that a session without any applications should be available under the time a reconnect hash can be used. That differs from before were a session life is during an application is running.
Final solution is committed upstream r1692 (rdesktop) and r1693 (seamlessrdp).
rdesktop, the meaning of arguments have been changed, -A needs an string which
specifies were seamlessrdpshell.exe reside on the WTS server, -s is either a plain shell or when -A is specified a application to spawn in the seamless shell.
Starting rdesktop with -A and no application specified with -s will establish a seamless connection without any applications running. Any subsequent call to rdesktop with -s specified will spawn an application in the alread established seamless connection see connection sharing bug for more information.
The following rdesktop call will establish a seamless connection without any application:
#rdesktop -A "c:\\seamlessrdp\\seamlesrdpshell.exe" -u myuser -d mydomain mywts.domain.com
And the following two calls to rdesktop will spawn notepad and mspaint in the alreadt established connection:
#rdesktop -A "c:\\seamlessrdp\\seamlesrdpshell.exe" -u myuser -d mydomain -s "notepad"
#rdesktop -A "c:\\seamlessrdp\\seamlesrdpshell.exe" -u myuser -d mydomain -s "mspaint"
Vendordrop in commit r26505 and r26510
Starting this works like a charm. Tested on Windows 2008r2 with tl-run-winapp-seamless.
Also tested that an "empty" session will self terminate if left disconnected. And will be left alive if there are still processes running.