I wrote:

> Patch 8.1.2251
> Problem:    ":term command" may not work without a shell.
> Solution:   Add the ++shell option to :term. (closes #3340)
> Files:            runtime/doc/terminal.txt, src/terminal.c,
>             src/os_unix.c, src/proto/os_unix.pro,
>             src/testdir/test_terminal.vim

This only supports Unix.  I have a first change to make it work on
MS-Windows, but not sure how to test it.  Someone wants to have a go at
it?


--- ../../git/vim81/src/terminal.c      2019-11-03 23:37:08.292934356 +0100
+++ terminal.c  2019-11-03 23:44:31.294556861 +0100
@@ -846,21 +846,31 @@
            term_start(NULL, argv, &opt, eap->forceit ? TERM_START_FORCEIT : 0);
        vim_free(tofree1);
        vim_free(tofree2);
+       goto theend;
 #else
+# ifdef MSWIN
+       long_u      cmdlen = STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10;
+       char_u      *newcmd;
+
+       newcmd = alloc(cmdlen);
+       if (newcmd == NULL)
+           goto theend;
+       tofree = newcmd;
+       vim_snprintf((char *)newcmd, cmdlen, "%s %s %s", p_sh, p_shcf, cmd);
+       cmd = newcmd;
+# else
        emsg(_("E279: Sorry, ++shell is not supported on this system"));
+       goto theend;
+# endif
 #endif
     }
-    else
-    {
-       argvar[0].v_type = VAR_STRING;
-       argvar[0].vval.v_string = cmd;
-       argvar[1].v_type = VAR_UNKNOWN;
-       term_start(argvar, NULL, &opt, eap->forceit ? TERM_START_FORCEIT : 0);
-    }
-
-    vim_free(tofree);
+    argvar[0].v_type = VAR_STRING;
+    argvar[0].vval.v_string = cmd;
+    argvar[1].v_type = VAR_UNKNOWN;
+    term_start(argvar, NULL, &opt, eap->forceit ? TERM_START_FORCEIT : 0);
 
 theend:
+    vim_free(tofree);
     vim_free(opt.jo_eof_chars);
 }
 

-- 
How To Keep A Healthy Level Of Insanity:
18. When leaving the zoo, start running towards the parking lot,
    yelling "run for your lives, they're loose!!"

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201911032248.xA3MmJk6018002%40masaka.moolenaar.net.

Raspunde prin e-mail lui