#10060·nushell

shebangs in windows

Author: YakiyoCreated Aug 19, 2023Updated Sep 17, 2026
Labelsplatform:windowsusage:script-file

Related problem

From the book, it says that shebangs in nu scripts are supported in linux and macos (ref). Shebangs are by default not supported in the original windows consoles (cmd, powershell) but ones like bash, zsh all do. In fact git bash for windows also support shebangs in scripts. An example script being

nu
#!/usr/bin/env nu
"Hello World!"

This when ran in git bash image When ran in nu image it doesnt run and instead i get a prompt asking about which app to use for opening it

Again when naming the file without an extension, e.g script instead of script.nu On bash image On nu image

Describe the solution you'd like

It would be really good if shebangs were supported in windows too. It doesnt really make sense for it to work on linux/mac but not on win. It can make scripting much easier. I dont believe its a platform related issue but rather shebangs are implemented by the shell themselves (idk, i might be wrong) so it would really be a useful feature.

Describe alternatives you've considered

No response

Additional context and details

No response