Enum Class WindowsLoginShell
- All Implemented Interfaces:
Serializable,Comparable<WindowsLoginShell>,Constable
DefaultShell. It decides how the
remoting start command must be quoted.
SSHLauncher launches the agent with a hardcoded cd "<workDir>" && java ...
command. && is a valid statement separator in cmd.exe and in PowerShell 7+
(pwsh), so those shells run the command as-is. Windows PowerShell 5.x rejects it
("The token '&&' is not a valid statement separator in this version") and the agent JVM
never starts. For PowerShell the command is wrapped as cmd /c '<command>': PowerShell
treats the single-quoted body as one literal argument (so it never tries to parse &&) and
hands it to cmd.exe, which runs cd "..." && java ... correctly. This was verified
against a live Win32-OpenSSH PowerShell 5.1 shell; note PowerShell's --% stop-parsing
token does NOT work over the OpenSSH exec channel, so it is not used.
AUTO (the default) detects the shell at launch instead of asking the user to pick it
(see ProxmoxLauncher.detectWindowsShell); the explicit values remain as manual overrides.
The prefix and suffix are applied via
SSHLauncher.setPrefixStartSlaveCmd(java.lang.String) and
SSHLauncher.setSuffixStartSlaveCmd(java.lang.String). Only relevant for Windows
agents; Linux agents never wrap the command.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDetect the shell at launch and wrap only if it rejects&&.cmd.exe(the OpenSSH default when noDefaultShellis set).PowerShell. -
Method Summary
Modifier and TypeMethodDescriptionPrefix prepended toSSHLauncher's agent-start command so it runs under this shell.Suffix appended toSSHLauncher's agent-start command (closes the wrapper, if any).static WindowsLoginShellReturns the enum constant of this class with the specified name.static WindowsLoginShell[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
Detect the shell at launch and wrap only if it rejects&&. Resolves to CMD or POWERSHELL. -
CMD
cmd.exe(the OpenSSH default when noDefaultShellis set). Needs no wrapper. -
POWERSHELL
PowerShell. Windows PowerShell 5.x cannot parse&&, so the command is wrapped ascmd /c '<command>'. The wrapper is a literal single-quoted string in every PowerShell version, so it is safe for both Windows PowerShell 5.x and PowerShell 7+.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getDisplayName
-
getStartCommandPrefix
Prefix prepended toSSHLauncher's agent-start command so it runs under this shell. Empty when the shell already acceptsSSHLauncher's&&syntax. -
getStartCommandSuffix
Suffix appended toSSHLauncher's agent-start command (closes the wrapper, if any).
-