Background tasks automatically killed on Ubuntu tab of Windows terminal #4059

Closed
opened 2026-01-30 23:37:03 +00:00 by claunia · 5 comments
Owner

Originally created by @betteridiot on GitHub (Sep 25, 2019).

Environment

Windows build number: 10.0.18985.0 Microsoft Windows NT 10.0.18985.0
Windows Terminal version (if applicable):  0.4.2382.0

Any other software?
Google Chrome Version 77.0.3865.90 (Official Build) (64-bit)
Ubuntu 18.04.3 LTS from Microsoft Store
conda 4.7.12
Virtual Environment:
channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - _libgcc_mutex=0.1=main
  - attrs=19.1.0=py_0
  - backcall=0.1.0=py_0
  - bleach=3.1.0=py_0
  - bzip2=1.0.8=h516909a_1
  - ca-certificates=2019.9.11=hecc5488_0
  - certifi=2019.9.11=py37_0
  - cycler=0.10.0=py_1
  - dbus=1.13.6=he372182_0
  - decorator=4.4.0=py_0
  - defusedxml=0.5.0=py_1
  - entrypoints=0.3=py37_1000
  - expat=2.2.5=he1b5a44_1003
  - fontconfig=2.13.1=h86ecdb6_1001
  - freetype=2.10.0=he983fc9_1
  - gettext=0.19.8.1=hc5be6a0_1002
  - glib=2.58.3=h6f030ca_1002
  - gst-plugins-base=1.14.5=h0935bb2_0
  - gstreamer=1.14.5=h36ae1b5_0
  - icu=64.2=he1b5a44_1
  - ipykernel=5.1.2=py37h5ca1d4c_0
  - ipython=7.8.0=py37h5ca1d4c_0
  - ipython_genutils=0.2.0=py_1
  - ipywidgets=7.5.1=py_0
  - jedi=0.15.1=py37_0
  - jinja2=2.10.1=py_0
  - joblib=0.13.2=py_0
  - jpeg=9c=h14c3975_1001
  - json5=0.8.5=py_0
  - jsonschema=3.0.2=py37_0
  - jupyter=1.0.0=py_2
  - jupyter_client=5.3.1=py_0
  - jupyter_console=6.0.0=py_0
  - jupyter_core=4.4.0=py_0
  - jupyterlab=1.1.4=py_0
  - jupyterlab_server=1.0.6=py_0
  - kiwisolver=1.1.0=py37hc9558a2_0
  - libblas=3.8.0=12_openblas
  - libcblas=3.8.0=12_openblas
  - libffi=3.2.1=he1b5a44_1006
  - libgcc-ng=9.1.0=hdf63c60_0
  - libgfortran-ng=7.3.0=hdf63c60_0
  - libiconv=1.15=h516909a_1005
  - liblapack=3.8.0=12_openblas
  - libopenblas=0.3.7=h6e990d7_1
  - libpng=1.6.37=hed695b0_0
  - libsodium=1.0.17=h516909a_0
  - libstdcxx-ng=9.1.0=hdf63c60_0
  - libuuid=2.32.1=h14c3975_1000
  - libuv=1.30.1=h516909a_0
  - libxcb=1.13=h14c3975_1002
  - libxml2=2.9.9=hee79883_5
  - markupsafe=1.1.1=py37h14c3975_0
  - matplotlib=3.1.1=py37_1
  - matplotlib-base=3.1.1=py37he7580a8_1
  - mistune=0.8.4=py37h14c3975_1000
  - nbconvert=5.6.0=py37_1
  - nbformat=4.4.0=py_1
  - ncurses=6.1=hf484d3e_1002
  - nodejs=12.8.1=h10a4023_0
  - notebook=5.7.2=py37_1000
  - numpy=1.17.2=py37h95a1406_0
  - openssl=1.1.1c=h516909a_0
  - pandas=0.25.1=py37hb3f55d8_0
  - pandoc=2.7.3=0
  - pandocfilters=1.4.2=py_1
  - parso=0.5.1=py_0
  - patsy=0.5.1=py_0
  - pcre=8.41=hf484d3e_1003
  - pexpect=4.7.0=py37_0
  - pickleshare=0.7.5=py37_1000
  - pip=19.2.3=py37_0
  - prometheus_client=0.7.1=py_0
  - prompt_toolkit=2.0.9=py_0
  - pthread-stubs=0.4=h14c3975_1001
  - ptyprocess=0.6.0=py_1001
  - pygments=2.4.2=py_0
  - pyparsing=2.4.2=py_0
  - pyqt=5.9.2=py37hcca6a23_4
  - pyrsistent=0.15.4=py37h516909a_0
  - python=3.7.3=h33d41f4_1
  - python-dateutil=2.8.0=py_0
  - pytz=2019.2=py_0
  - pyzmq=18.1.0=py37h1768529_0
  - qt=5.9.7=h0c104cb_3
  - qtconsole=4.5.5=py_0
  - readline=8.0=hf8c457e_0
  - scikit-learn=0.21.3=py37hcdab131_0
  - scipy=1.3.1=py37h921218d_2
  - seaborn=0.9.0=py_1
  - send2trash=1.5.0=py_0
  - setuptools=41.2.0=py37_0
  - sip=4.19.8=py37hf484d3e_1000
  - six=1.12.0=py37_1000
  - sqlite=3.29.0=hcee41ef_1
  - statsmodels=0.10.1=py37hc1659b7_0
  - terminado=0.8.2=py37_0
  - testpath=0.4.2=py_1001
  - tk=8.6.9=hed695b0_1003
  - tornado=5.1.1=py37h14c3975_1000
  - traitlets=4.3.2=py37_1000
  - wcwidth=0.1.7=py_1
  - webencodings=0.5.1=py_1
  - wheel=0.33.6=py37_0
  - widgetsnbextension=3.5.1=py37_0
  - xorg-libxau=1.0.9=h14c3975_0
  - xorg-libxdmcp=1.1.3=h516909a_0
  - xz=5.2.4=h14c3975_1001
  - zeromq=4.3.2=he1b5a44_2
  - zlib=1.2.11=h516909a_1006

Steps to reproduce

  • Set Google Chrome (or any other Windows-side browser) as a BROWSER environmental variable:

export BROWSER='$(wslpath <Windows-side Chrome target path>)'

  • Start a Jupyter server (Notebook or Lab, doesn't matter) that will launch Chrome to render in the background using the following command:

jupyter lab --notebook-dir=~ &> /dev/null &

The process spawns and renders correctly. However, as soon as something is entered into the prompt (e.g. ls) that spawned the background task, the background task is killed (see screen capture gif below)

Expected behavior

I expect that the process will spawn a Jupyter server as a background task and Chrome will render the output on the Windows side. As the prompt is released to the fg, I should be able to type whatever I want into prompt and the background task is kept alive.

Note: This works as expected when using the Ubuntu standalone app (outside of Windows terminal)

Actual behavior

As seen below, the server is sent to background (as expected), launches Chrome (off screen and as expected), and releases the prompt to foreground.

However, as soon as any command is entered into the fg prompt, the background server is killed.

Originally created by @betteridiot on GitHub (Sep 25, 2019). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18985.0 Microsoft Windows NT 10.0.18985.0 Windows Terminal version (if applicable): 0.4.2382.0 Any other software? Google Chrome Version 77.0.3865.90 (Official Build) (64-bit) Ubuntu 18.04.3 LTS from Microsoft Store conda 4.7.12 Virtual Environment: channels: - conda-forge - bioconda - defaults dependencies: - _libgcc_mutex=0.1=main - attrs=19.1.0=py_0 - backcall=0.1.0=py_0 - bleach=3.1.0=py_0 - bzip2=1.0.8=h516909a_1 - ca-certificates=2019.9.11=hecc5488_0 - certifi=2019.9.11=py37_0 - cycler=0.10.0=py_1 - dbus=1.13.6=he372182_0 - decorator=4.4.0=py_0 - defusedxml=0.5.0=py_1 - entrypoints=0.3=py37_1000 - expat=2.2.5=he1b5a44_1003 - fontconfig=2.13.1=h86ecdb6_1001 - freetype=2.10.0=he983fc9_1 - gettext=0.19.8.1=hc5be6a0_1002 - glib=2.58.3=h6f030ca_1002 - gst-plugins-base=1.14.5=h0935bb2_0 - gstreamer=1.14.5=h36ae1b5_0 - icu=64.2=he1b5a44_1 - ipykernel=5.1.2=py37h5ca1d4c_0 - ipython=7.8.0=py37h5ca1d4c_0 - ipython_genutils=0.2.0=py_1 - ipywidgets=7.5.1=py_0 - jedi=0.15.1=py37_0 - jinja2=2.10.1=py_0 - joblib=0.13.2=py_0 - jpeg=9c=h14c3975_1001 - json5=0.8.5=py_0 - jsonschema=3.0.2=py37_0 - jupyter=1.0.0=py_2 - jupyter_client=5.3.1=py_0 - jupyter_console=6.0.0=py_0 - jupyter_core=4.4.0=py_0 - jupyterlab=1.1.4=py_0 - jupyterlab_server=1.0.6=py_0 - kiwisolver=1.1.0=py37hc9558a2_0 - libblas=3.8.0=12_openblas - libcblas=3.8.0=12_openblas - libffi=3.2.1=he1b5a44_1006 - libgcc-ng=9.1.0=hdf63c60_0 - libgfortran-ng=7.3.0=hdf63c60_0 - libiconv=1.15=h516909a_1005 - liblapack=3.8.0=12_openblas - libopenblas=0.3.7=h6e990d7_1 - libpng=1.6.37=hed695b0_0 - libsodium=1.0.17=h516909a_0 - libstdcxx-ng=9.1.0=hdf63c60_0 - libuuid=2.32.1=h14c3975_1000 - libuv=1.30.1=h516909a_0 - libxcb=1.13=h14c3975_1002 - libxml2=2.9.9=hee79883_5 - markupsafe=1.1.1=py37h14c3975_0 - matplotlib=3.1.1=py37_1 - matplotlib-base=3.1.1=py37he7580a8_1 - mistune=0.8.4=py37h14c3975_1000 - nbconvert=5.6.0=py37_1 - nbformat=4.4.0=py_1 - ncurses=6.1=hf484d3e_1002 - nodejs=12.8.1=h10a4023_0 - notebook=5.7.2=py37_1000 - numpy=1.17.2=py37h95a1406_0 - openssl=1.1.1c=h516909a_0 - pandas=0.25.1=py37hb3f55d8_0 - pandoc=2.7.3=0 - pandocfilters=1.4.2=py_1 - parso=0.5.1=py_0 - patsy=0.5.1=py_0 - pcre=8.41=hf484d3e_1003 - pexpect=4.7.0=py37_0 - pickleshare=0.7.5=py37_1000 - pip=19.2.3=py37_0 - prometheus_client=0.7.1=py_0 - prompt_toolkit=2.0.9=py_0 - pthread-stubs=0.4=h14c3975_1001 - ptyprocess=0.6.0=py_1001 - pygments=2.4.2=py_0 - pyparsing=2.4.2=py_0 - pyqt=5.9.2=py37hcca6a23_4 - pyrsistent=0.15.4=py37h516909a_0 - python=3.7.3=h33d41f4_1 - python-dateutil=2.8.0=py_0 - pytz=2019.2=py_0 - pyzmq=18.1.0=py37h1768529_0 - qt=5.9.7=h0c104cb_3 - qtconsole=4.5.5=py_0 - readline=8.0=hf8c457e_0 - scikit-learn=0.21.3=py37hcdab131_0 - scipy=1.3.1=py37h921218d_2 - seaborn=0.9.0=py_1 - send2trash=1.5.0=py_0 - setuptools=41.2.0=py37_0 - sip=4.19.8=py37hf484d3e_1000 - six=1.12.0=py37_1000 - sqlite=3.29.0=hcee41ef_1 - statsmodels=0.10.1=py37hc1659b7_0 - terminado=0.8.2=py37_0 - testpath=0.4.2=py_1001 - tk=8.6.9=hed695b0_1003 - tornado=5.1.1=py37h14c3975_1000 - traitlets=4.3.2=py37_1000 - wcwidth=0.1.7=py_1 - webencodings=0.5.1=py_1 - wheel=0.33.6=py37_0 - widgetsnbextension=3.5.1=py37_0 - xorg-libxau=1.0.9=h14c3975_0 - xorg-libxdmcp=1.1.3=h516909a_0 - xz=5.2.4=h14c3975_1001 - zeromq=4.3.2=he1b5a44_2 - zlib=1.2.11=h516909a_1006 ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> * Set Google Chrome (or any other Windows-side browser) as a `BROWSER` environmental variable: > `export BROWSER='$(wslpath <Windows-side Chrome target path>)'` * Start a Jupyter server (Notebook or Lab, doesn't matter) that will launch Chrome to render in the background using the following command: >`jupyter lab --notebook-dir=~ &> /dev/null &` The process spawns and renders correctly. However, as soon as something is entered into the prompt (e.g. `ls`) that spawned the background task, the background task is killed (see screen capture gif below) # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> I expect that the process will spawn a Jupyter server as a background task and Chrome will render the output on the Windows side. As the prompt is released to the `fg`, I should be able to type whatever I want into prompt and the background task is kept alive. **Note:** This works as expected when using the Ubuntu standalone app (outside of Windows terminal) # Actual behavior <!-- What's actually happening? --> As seen below, the server is sent to background (as expected), launches Chrome (off screen and as expected), and releases the prompt to foreground. However, as soon as any command is entered into the `fg` prompt, the background server is killed. ![](https://raw.githubusercontent.com/betteridiot/office_hours/master/bg_kill.gif)
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-30 23:37:03 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 26, 2019):

The Jupyter process is entering a stopped state because it’s requesting input, but it can’t receive input when it’s backgrounded. This isn’t something terminal can help with: you cannot background a process and expect it to stay in the background when it needs input, even on actual Linux.

@DHowett-MSFT commented on GitHub (Sep 26, 2019): The Jupyter process is entering a stopped state because it’s requesting input, but it can’t receive input when it’s backgrounded. This isn’t something terminal can help with: you cannot background a process and expect it to stay in the background when it needs input, even on actual Linux.
Author
Owner

@betteridiot commented on GitHub (Sep 26, 2019):

The issue is that this works perfectly fine on Ubuntu bash and have been doing this for a couple years now. This command has been an alias I use almost daily. It just doesn't work on Windows Terminal...as stated in my issue

@betteridiot commented on GitHub (Sep 26, 2019): The issue is that this works perfectly fine on Ubuntu bash and have been doing this for a couple years now. This command has been an alias I use almost daily. It just doesn't work on Windows Terminal...as stated in my issue
Author
Owner

@betteridiot commented on GitHub (Sep 26, 2019):

@DHowett-MSFT

@betteridiot commented on GitHub (Sep 26, 2019): @DHowett-MSFT
Author
Owner

@betteridiot commented on GitHub (Sep 26, 2019):

I realized that this problem only occurs when using WSL 2 in Windows Terminal. Problem no longer persists if I use WSL 1

@betteridiot commented on GitHub (Sep 26, 2019): I realized that this problem only occurs when using WSL 2 in Windows Terminal. Problem no longer persists if I use WSL 1
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 26, 2019):

@betteridiot seems like a compliance issue then; WSL2 is an actual linux kernel, so I am willing to bet that WSL1 had the wrong implementation for stop-on-read.

There’s probably a way to launch Jupyter that’ll ameliorate the issue and make it not prompt for input.

@DHowett-MSFT commented on GitHub (Sep 26, 2019): @betteridiot seems like a compliance issue then; WSL2 is an actual linux kernel, so I am willing to bet that WSL1 had the wrong implementation for stop-on-read. There’s probably a way to launch Jupyter that’ll ameliorate the issue and make it not prompt for input.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4059