Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: xterm: Add Wayland support

Under Wayland, we should check WAYLAND_DISPLAY instead.

Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20250326070113.401857-2-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Tiwei Bie and committed by
Johannes Berg
9456e2c6 92a09c47

+3 -6
+3 -6
arch/um/drivers/xterm.c
··· 97 97 if (access(argv[4], X_OK) < 0) 98 98 argv[4] = "port-helper"; 99 99 100 - /* 101 - * Check that DISPLAY is set, this doesn't guarantee the xterm 102 - * will work but w/o it we can be pretty sure it won't. 103 - */ 104 - if (getenv("DISPLAY") == NULL) { 105 - printk(UM_KERN_ERR "xterm_open: $DISPLAY not set.\n"); 100 + /* Ensure we are running on Xorg or Wayland. */ 101 + if (!getenv("DISPLAY") && !getenv("WAYLAND_DISPLAY")) { 102 + printk(UM_KERN_ERR "xterm_open : neither $DISPLAY nor $WAYLAND_DISPLAY is set.\n"); 106 103 return -ENODEV; 107 104 } 108 105