comparison src/terminal.c @ 18522:dfdc29643c91 v8.1.2255

patch 8.1.2255: ":term ++shell" does not work on MS-Windows Commit: https://github.com/vim/vim/commit/2d6d76f9cd3c5dca0676491d7d60ff7685942487 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 4 23:18:35 2019 +0100 patch 8.1.2255: ":term ++shell" does not work on MS-Windows Problem: ":term ++shell" does not work on MS-Windows. Solution: Add MS-Windows support.
author Bram Moolenaar <Bram@vim.org>
date Mon, 04 Nov 2019 23:30:03 +0100
parents 39b0c28fe495
children 517bfb2998aa
comparison
equal deleted inserted replaced
18521:cecc669d952c 18522:dfdc29643c91
844 // :term ++shell command 844 // :term ++shell command
845 if (unix_build_argv(cmd, &argv, &tofree1, &tofree2) == OK) 845 if (unix_build_argv(cmd, &argv, &tofree1, &tofree2) == OK)
846 term_start(NULL, argv, &opt, eap->forceit ? TERM_START_FORCEIT : 0); 846 term_start(NULL, argv, &opt, eap->forceit ? TERM_START_FORCEIT : 0);
847 vim_free(tofree1); 847 vim_free(tofree1);
848 vim_free(tofree2); 848 vim_free(tofree2);
849 goto theend;
849 #else 850 #else
851 # ifdef MSWIN
852 long_u cmdlen = STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10;
853 char_u *newcmd;
854
855 newcmd = alloc(cmdlen);
856 if (newcmd == NULL)
857 goto theend;
858 tofree = newcmd;
859 vim_snprintf((char *)newcmd, cmdlen, "%s %s %s", p_sh, p_shcf, cmd);
860 cmd = newcmd;
861 # else
850 emsg(_("E279: Sorry, ++shell is not supported on this system")); 862 emsg(_("E279: Sorry, ++shell is not supported on this system"));
851 #endif 863 goto theend;
852 } 864 # endif
853 else 865 #endif
854 { 866 }
855 argvar[0].v_type = VAR_STRING; 867 argvar[0].v_type = VAR_STRING;
856 argvar[0].vval.v_string = cmd; 868 argvar[0].vval.v_string = cmd;
857 argvar[1].v_type = VAR_UNKNOWN; 869 argvar[1].v_type = VAR_UNKNOWN;
858 term_start(argvar, NULL, &opt, eap->forceit ? TERM_START_FORCEIT : 0); 870 term_start(argvar, NULL, &opt, eap->forceit ? TERM_START_FORCEIT : 0);
859 } 871
860 872 theend:
861 vim_free(tofree); 873 vim_free(tofree);
862
863 theend:
864 vim_free(opt.jo_eof_chars); 874 vim_free(opt.jo_eof_chars);
865 } 875 }
866 876
867 #if defined(FEAT_SESSION) || defined(PROTO) 877 #if defined(FEAT_SESSION) || defined(PROTO)
868 /* 878 /*