Skip to content

Commit 2cfb138

Browse files
committed
Add local shell access feature in sftp.exe client
This was not implemented before in Win32. !takes to the windows shell and !command runs the command in Windows shell. exit brings the user back to sftp like in Linux/Unix shell.
1 parent 98dc596 commit 2cfb138

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

sftp.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,12 @@ help(void)
292292
static void
293293
local_do_shell(const char *args)
294294
{
295-
#ifdef WIN32_FIXME
295+
#ifdef WIN32_FIXME
296296

297-
/*
298-
* Not implemented on native Win32.
299-
*/
300-
301-
fprintf(stderr, "Local shell is not implemented on Win32.\n");
302-
297+
if (!*args) {
298+
args = (char *) getenv("ComSpec"); // get name of Windows cmd shell
299+
}
300+
system(args); // execute the shell or cmd given
303301
#else
304302

305303
/*

0 commit comments

Comments
 (0)