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.

Powershell support is great, but millions of people know bash and other unix shells and will expect support for it to be “in the box”. Currently you can simulate it via this:

#!pwsh
bash -c "ls ~/.nuget/packages/libtorch-cpu/0.3.52118/runtimes/linux-x64/native"

I’d like this to just be

#!bash
ls ~/.nuget

If you can point me in the right direction I can attempt to add an extension that enables this, at least for Linux. We could also add support for bash on WSL, perhaps separately.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:21 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
jonsequiturcommented, May 23, 2020

! would be difficult as a reserved prefix for the same reason that we moved away from %, which is that it introduces ambiguities with the embedded languages. # and #! were already effectively comments in C#, F#, PowerShell, and several other languages.

That said, within .NET Interactive, #!-prefixed magic commands are user-extensible, including the custom command line syntax, so #!bash -c echo "hello" would be straightforward.

The default language for a notebook is mapped to the kernel name, which is why in Jupyter we install three different “kernels”. The difference between them is just the command line arguments to dotnet-interactive in the kernelspec, in effect:

> dotnet interactive jupyter --default-kernel fsharp /path/to/connectionfile
1reaction
TylerLeonhardtcommented, May 27, 2020

I can sympathize with wanting a magic command for running a command in the shell that’s available on the system.

@dsyme I’m sure your example is a bit of a simplification of something much larger… but ls is ls in PowerShell.

That is to say

#!pwsh
ls ~/.nuget/packages/libtorch-cpu/0.3.52118/runtimes/linux-x64/native

uses the actual ls executable. Any linux executable on the PATH is available in PowerShell.

But yeah a way to invoke one-off commands in whatever the default shell is would be nice.

The only thing we need to be careful is the feature creep because PowerShell support is more than just a shell/one off commands - you get plotting, and get/set variables from other languages, and other rich features of .NET Interactive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BashSupport Pro: Bash script support for IntelliJ and other ...
A powerful Bash and shell script plugin for IntelliJ IDEA, PyCharm, WebStorm, and other IDEs made by JetBrains.
Read more >
BashSupport - IntelliJ IDEs Plugin
Bash language support for 2020.1 and earlier. Note to all users: Prompted by changes in the JetBrains default plugin offerings, a slow transition...
Read more >
Contact Us With Your Questions & Feedback
Our Bash Support Team is here to help with any question or comments you might have. Email support@bash.com. Operating hours: Monday – Friday:...
Read more >
WolfgangMehner/bash-support: Edit Bash scripts in Vim ...
Edit Bash scripts in Vim/gVim. Insert code snippets, run, check, and debug the code and look up help. - GitHub - WolfgangMehner/bash-support: Edit...
Read more >
Bash IDE -- Insert code snippets, run, check and debug ...
package script version date Vim version user bash‑support.zip 4.3 2016‑08‑16 7.3 Fritz Mehner bash‑support.zip 4.2.1 2014‑04‑21 7.0 Fritz Mehner bash‑support.zip 4.2 2014‑01‑04 7.0 Fritz Mehner
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