mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
Merge pull request #2969 from tamuhey/iss2698_wsl_pipe
Iss2698 wsl pipe
This commit is contained in:
commit
b9594fa85d
3 changed files with 19 additions and 2 deletions
8
news/iss2698_wsl_pipe.rst
Normal file
8
news/iss2698_wsl_pipe.rst
Normal file
|
@ -0,0 +1,8 @@
|
|||
**Added:**
|
||||
|
||||
* ON_WSL attribute in platform.py
|
||||
|
||||
**Changed:**
|
||||
|
||||
* If we are on wsl, avoid to use xonsh_preexec_fn when pipe.
|
||||
|
|
@ -13,6 +13,7 @@ import shlex
|
|||
import signal
|
||||
import atexit
|
||||
import pathlib
|
||||
import platform
|
||||
import inspect
|
||||
import warnings
|
||||
import builtins
|
||||
|
@ -27,7 +28,7 @@ from xonsh.inspectors import Inspector
|
|||
from xonsh.aliases import Aliases, make_default_aliases
|
||||
from xonsh.environ import Env, default_env, locate_binary
|
||||
from xonsh.jobs import add_job
|
||||
from xonsh.platform import ON_POSIX, ON_WINDOWS
|
||||
from xonsh.platform import ON_POSIX, ON_WINDOWS, ON_WSL
|
||||
from xonsh.proc import (
|
||||
PopenThread,
|
||||
ProcProxyThread,
|
||||
|
@ -579,7 +580,9 @@ class SubprocSpec:
|
|||
return
|
||||
if not builtins.__xonsh__.env.get("XONSH_INTERACTIVE"):
|
||||
return
|
||||
if pipeline_group is None:
|
||||
if pipeline_group is None or ON_WSL:
|
||||
# If there is no pipeline group
|
||||
# or the platform is windows subsystem for linux (WSL)
|
||||
xonsh_preexec_fn = no_pg_xonsh_preexec_fn
|
||||
else:
|
||||
|
||||
|
|
|
@ -76,6 +76,12 @@ def ON_BEOS():
|
|||
return sys.platform == "beos5" or sys.platform == "haiku1"
|
||||
|
||||
|
||||
@lazybool
|
||||
def ON_WSL():
|
||||
"""True if we are on Windows Subsystem for Linux (WSL)"""
|
||||
return "Microsoft" in platform.release()
|
||||
|
||||
|
||||
#
|
||||
# Python & packages
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue