mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
'pterm --display' should set $DISPLAY inside the terminal.
If you open a pterm on a different display via the --display command-line option rather than by setting $DISPLAY, I think (and other terminals seem to agree) that it's sensible to set $DISPLAY anyway for processes running inside the terminal. (cherry picked from commit dc16dd5aa4a3fb2e367bc6303963321e628594ac)
This commit is contained in:
parent
417421cace
commit
0eb3bf07fc
13
unix/uxpty.c
13
unix/uxpty.c
@ -834,6 +834,19 @@ static const char *pty_init(void *frontend, void **backend_handle, Conf *conf,
|
||||
* environment in place.
|
||||
*/
|
||||
}
|
||||
{
|
||||
/*
|
||||
* In case we were invoked with a --display argument that
|
||||
* doesn't match DISPLAY in our actual environment, we
|
||||
* should set DISPLAY for processes running inside the
|
||||
* terminal to match the display the terminal itself is
|
||||
* on.
|
||||
*/
|
||||
const char *x_display = get_x_display(pty->frontend);
|
||||
char *x_display_env_var = dupprintf("DISPLAY=%s", x_display);
|
||||
putenv(x_display_env_var);
|
||||
/* As above, we don't free this. */
|
||||
}
|
||||
#endif
|
||||
{
|
||||
char *key, *val;
|
||||
|
Loading…
x
Reference in New Issue
Block a user