[util/cli] fix CLI invokation for sway
in sway/wayland, make sure that the wayland socket is cleared, which seems to cause issue for some unspecified reason. also, while at it, improve code so that the environment dict that is passed in is *not* modified. fixes #628
This commit is contained in:
parent
350648b0cd
commit
fc8783ee13
1 changed files with 7 additions and 2 deletions
|
@ -33,14 +33,19 @@ def execute(
|
|||
|
||||
if not env:
|
||||
env = os.environ.copy()
|
||||
env["LC_ALL"] = "C"
|
||||
|
||||
myenv = env.copy()
|
||||
|
||||
myenv["LC_ALL"] = "C"
|
||||
if "WAYLAND_SOCKET" in myenv:
|
||||
del myenv["WAYLAND_SOCKET"]
|
||||
|
||||
try:
|
||||
proc = subprocess.Popen(
|
||||
args,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT if include_stderr else subprocess.PIPE,
|
||||
env=env,
|
||||
env=myenv,
|
||||
shell=shell,
|
||||
)
|
||||
except FileNotFoundError as e:
|
||||
|
|
Loading…
Reference in a new issue