#endif
#if !defined(USE_SYSTEM) || defined(FEAT_JOB_CHANNEL)
+/*
+ * Set the environment for a child process.
+ */
static void
set_child_environment(long rows, long columns, char *term)
{
static char envbuf_Lines[20];
static char envbuf_Columns[20];
static char envbuf_Colors[20];
+ static char envbuf_Servername[60];
# endif
long colors =
# ifdef FEAT_GUI
# endif
t_colors;
- /* Simulate to have a dumb terminal (for now) */
# ifdef HAVE_SETENV
setenv("TERM", term, 1);
sprintf((char *)envbuf, "%ld", rows);
setenv("COLUMNS", (char *)envbuf, 1);
sprintf((char *)envbuf, "%ld", colors);
setenv("COLORS", (char *)envbuf, 1);
+ setenv("VIM_SERVERNAME", serverName == NULL ? "" : (char *)serverName, 1);
# else
/*
* Putenv does not copy the string, it has to remain valid.
* Use a static array to avoid losing allocated memory.
+ * This won't work well when running multiple children...
*/
vim_snprintf(envbuf_Term, sizeof(envbuf_Term), "TERM=%s", term);
putenv(envbuf_Term);
putenv(envbuf_Columns);
vim_snprintf(envbuf_Colors, sizeof(envbuf_Colors), "COLORS=%ld", colors);
putenv(envbuf_Colors);
+ vim_snprintf(envbuf_Servername, sizeof(envbuf_Servername),
+ "VIM_SERVERNAME=%s", serverName == NULL ? "" : (char *)serverName);
+ putenv(envbuf_Servername);
# endif
}