question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'!' always uses the system shell - no way to change it

See original GitHub issue

Running !ls works perfectly on native Jupyter, but throws a command not found error in VS Code. However, I am able to run !dir cmd/PowerShell commands on VS Code as well as native Jupyter.

Is there a way for me to change this setting, such that I ask Jupyter running on VS Code to let me run UNIX commands (which Git Bash/WSL allows)?

Environment data

  • VS Code version: 1.54.3
  • Jupyter Extension version (available under the Extensions sidebar): v2021.3.684299474
  • Python Extension version (available under the Extensions sidebar): v2021.3.680753044
  • OS (Windows | Mac | Linux distro) and version: Windows 10.0.19042 Build 19042
  • Python and/or Anaconda version: Python 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Jupyter server running: Local

Expected Output

vscode_cmd2

What I see

vscode_cmd1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Nov 29, 2021

It’s an enhancement because it’s behaving as designed. The enhancement would be to support that jupyter config setting so the user could change what shell is used.

0reactions
DonJayamannecommented, Aug 14, 2022

Closing this issue as this is how Jupyter works, and we don’t have any plans to provide some functionality that would work differently in VS Code compared to Jupyter, specially when it comes to execution of code against a kernel.

This is something that’s handled natively by the IPython kernel, hence would require changes upstream

Read more comments on GitHub >

github_iconTop Results From Across the Web

shell - Why not use "which"? What to use then?
I WANT the path to the executable file name. The fact that ls is a function on my system is the best reason...
Read more >
How To Change Shell To Bash in Linux / Unix - nixCraft
Explains how to set or change shell to bash (Bourne-again shell) on a Linux, macOS, FreeBSD, and Unix-like OS using the chsh command....
Read more >
Customizing Linux filesystem commands - Red Hat
The simplest way to customize your working terminal environment is by editing its configuration file, which contains your personal shell ...
Read more >
Choosing the Shell (GNU make)
Unlike most variables, the variable SHELL is never set from the environment. This is because the SHELL environment variable is used to specify...
Read more >
Invoke a System Command - R
On Windows, system does not use a shell and there is a separate function shell which passes command lines to a shell. If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found