Merge pull request #2969 from tamuhey/iss2698_wsl_pipe

Iss2698 wsl pipe
This commit is contained in:
Anthony Scopatz 2019-01-29 13:52:09 -05:00 committed by GitHub
commit b9594fa85d
Failed to generate hash of commit
3 changed files with 19 additions and 2 deletions

View 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.

View file

@ -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:

View file

@ -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
#