Skip to content

How can i add SSH as a command - and make it work? #748

@AlexData-Hawkhill

Description

@AlexData-Hawkhill

A very nice piece of software this SHELL! Thanks for the hard work put into it!
...but, i have a tiny issue that hinders me in using lots of commands i use often, with the Nilesoft Shell...

How can i add SSH as a command - and make it work? The problem is that the command has an "@" in it, and this is not "liked" by the SHELL...

Normally in CMD i would write: ssh user@server.com
and since i've setup a public/private key setup, this logs me into my SSH server.

But with SHELL, if i do this:
item(title="SSH server.com" tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K TITLE SSH TERMINAL &ssh "user@ssh.server.com" & PUSHD "@sel.dir" ')
Then SHELL silently crashes, and the context menu goes back to the default windows context menu.

I have attempted to remove the "@" by using AT instead:
item(title="SSH server.com" tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K TITLE SSH TERMINAL &ssh "userATssh.server.com" & PUSHD "@sel.dir" ')
This connects with the server but does not log the user in (even with pub/private working keys setup) and the ssh server will also not accept a manually typed password then, either...

So adding the "@" into the line of code, simply crashes SHELL silently and gracefully - so how can i do a command like this that includes "@" ??

Even a simple command like this would fail:
item(title="DosTest" tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K @echo test && PUSHD "@sel.dir" ')
with the cmd error: 'test' is not recognized as an internal or external command, operable program or batch file.

So clearly there are some issues with using "@" in a command... Can someone fill me in if there is a way around this?
if not, then this is an issue...

PS: In this case I import a file using import command in "shell.nss" and below is the code from that imported file, with both of the above semi-working examples included, for better context (pun intended, he he)

menu(type='*' where=(sel.count or wnd.is_taskbar or wnd.is_edit) title="Terminals" sep='top' image=icon.run_with_powershell)
{
	$tip_run_admin=["\xE1A7 Press SHIFT key to run " + this.title + " as administrator", tip.warning, 1.0]
	$has_admin=key.shift() or key.rbutton()
	
	item(title=title.command_prompt tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K TITLE Command Prompt &ver& PUSHD "@sel.dir"')
	item(title=title.windows_powershell admin=has_admin tip=tip_run_admin image cmd='powershell.exe' args='-noexit -command Set-Location -Path "@sel.dir\."')
	item(where=package.exists("WindowsTerminal") title=title.Windows_Terminal tip=tip_run_admin admin=has_admin image='@package.path("WindowsTerminal")\WindowsTerminal.exe' cmd='wt.exe' arg='-d "@sel.path\."')


	//trying to get "ssh", "sftp", and "scp" to work... //I'VE REMOVED MY ACTUAL USER AND SERVERNAME FROM THIS EXAMPLE...
	item(title="SSH server.com" tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K TITLE SSH TERMINAL &ssh "userATssh.server.com" & PUSHD "@sel.dir" ')

	//simple-dos-test-that-fails-with-an-error...
	item(title="DosTest" tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K @echo test && PUSHD "@sel.dir" ')
}

Please, i either need some help on this, or a possible fix for it, if it is an actual issue...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions