You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In windows OS, if sshd.exe is running as a system service then it will suppress the GUI applications and runs them in hidden mode when triggered through ssh.
So, to avoid running GUI applications in hidden mode, I'm running sshd.exe process in windows (client system) as local user instead of system service. And GUI applications in client can be seen when invoked through node-ssh.
Now, when ever node-ssh' exec, put file, get file methods are used, a cmd window pop up appears on the client system.
Is there way to hide this window pop up other than using pty?
When execOptions: { pty: { width: 0, height: 0 } } is used, window pop is avoided but it lead to another problem. Using pty, stderr is always empty. The data is redirected to stdout . Also the output contains some extra characters as below:
stderr is empty when exec command execution has error
{ code: null, signal: null, stdout: "\x1B[2J\x1B[m\x1B[H\x1B]0;Administrator: C:\\Windows\\system32\\conhost.exe\x07\x1B[?25h\x1B[38;5;9mwhoami. : The term 'whoami.' is not recognized as the name of a cmdlet, \x1B[m\x1B[38;5;9m\r\n" + 'function, script file, or operable program. Check the spelling of the name, or \r\n' + 'if a path was included, verify that the path is correct and try again.\r\n' + 'At line:1 char:1\r\n' + '+ whoami.\r\n' + '+ ~~~~~~~\r\n' + ' + CategoryInfo : ObjectNotFound: (whoami.:String) [], CommandNotF \r\n' + ' oundException\r\n' + ' + FullyQualifiedErrorId : CommandNotFoundException', stderr: '' }
The text was updated successfully, but these errors were encountered:
gotcha1
changed the title
how to hide command prompt window when using ssh exec, put file and get file?
how to hide command prompt window pop in client system when executing command or doing file operation using node-ssh
Aug 2, 2022
gotcha1
changed the title
how to hide command prompt window pop in client system when executing command or doing file operation using node-ssh
how to hide command prompt window pop up in client system when executing command or doing file operation using node-ssh
Aug 2, 2022
In windows OS, if sshd.exe is running as a system service then it will suppress the GUI applications and runs them in hidden mode when triggered through ssh.
So, to avoid running GUI applications in hidden mode, I'm running sshd.exe process in windows (client system) as local user instead of system service. And GUI applications in client can be seen when invoked through node-ssh.
Now, when ever node-ssh' exec, put file, get file methods are used, a cmd window pop up appears on the client system.
Is there way to hide this window pop up other than using pty?
When execOptions: { pty: { width: 0, height: 0 } } is used, window pop is avoided but it lead to another problem. Using pty, stderr is always empty. The data is redirected to stdout . Also the output contains some extra characters as below:
{ code: null, signal: null, stdout: '\x1B[2J\x1B[m\x1B[H\x1B]0;Administrator: C:\\Windows\\system32\\conhost.exe\x07\x1B[?25hdesktop-85hs42d\\administrator', stderr: '' }
stderr is empty when exec command execution has error
{ code: null, signal: null, stdout: "\x1B[2J\x1B[m\x1B[H\x1B]0;Administrator: C:\\Windows\\system32\\conhost.exe\x07\x1B[?25h\x1B[38;5;9mwhoami. : The term 'whoami.' is not recognized as the name of a cmdlet, \x1B[m\x1B[38;5;9m\r\n" + 'function, script file, or operable program. Check the spelling of the name, or \r\n' + 'if a path was included, verify that the path is correct and try again.\r\n' + 'At line:1 char:1\r\n' + '+ whoami.\r\n' + '+ ~~~~~~~\r\n' + ' + CategoryInfo : ObjectNotFound: (whoami.:String) [], CommandNotF \r\n' + ' oundException\r\n' + ' + FullyQualifiedErrorId : CommandNotFoundException', stderr: '' }
The text was updated successfully, but these errors were encountered: