termpty: set environment variable WINDOWID. Closes T7484

This commit is contained in:
Boris Faure 2018-12-24 11:10:01 +01:00
parent 262e014198
commit 10f6dc4737
3 changed files with 10 additions and 3 deletions

View File

@ -6298,6 +6298,7 @@ termio_add(Evas_Object *win, Config *config,
"gstreamer1"
};
char *mod = NULL;
Ecore_Window window_id;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
e = evas_object_evas_get(win);
@ -6346,9 +6347,10 @@ termio_add(Evas_Object *win, Config *config,
_smart_cb_drag_pos, obj,
_smart_cb_drop, obj);
window_id = elm_win_window_id_get(win);
sd->pty = termpty_new(cmd, login_shell, cd, w, h, config->scrollback,
config->xterm_256color, config->erase_is_del, mod,
title);
title, window_id);
if (!sd->pty)
{
ERR(_("Could not allocate termpty"));

View File

@ -477,7 +477,7 @@ Termpty *
termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
int w, int h, int backscroll, Eina_Bool xterm_256color,
Eina_Bool erase_is_del, const char *emotion_mod,
const char *title)
const char *title, Ecore_Window window_id)
{
Termpty *ty;
const char *pty;
@ -719,6 +719,11 @@ termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
snprintf(buf, sizeof(buf), "EMOTION_ENGINE=%s", emotion_mod);
putenv(buf);
}
if (window_id)
{
snprintf(buf, sizeof(buf), "WINDOWID=%lu", window_id);
putenv(buf);
}
if (!login_shell)
execvp(args[0], (char *const *)args);
else

View File

@ -260,7 +260,7 @@ void termpty_shutdown(void);
Termpty *termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
int w, int h, int backscroll, Eina_Bool xterm_256color,
Eina_Bool erase_is_del, const char *emotion_mod,
const char *title);
const char *title, Ecore_Window window_id);
void termpty_free(Termpty *ty);
void termpty_backlog_lock(void);