To be able to run Nushell scripts from your File Manager and have the terminal window of the running script not close when the script is finished executing or if the scripts exits, you can use these instructions to achieve this.
This example is on Linux Mint using Nemo as a file manager and GNOME Terminal as a terminal app.
- Create the following script on your system and store the file where ever you like...
run-in-terminal.nu
def run-in-terminal [code: string] {
# Using GNOME Terminal
gnome-terminal -- nu -c ($code)
}
# The Nushell code that runs in the terminal
def get-terminal-code [script: string] {
return $"
try {
nu ($script)
print ''
print ''
print ''
print 'Script finished executing'
} catch {
print ''
print ''
print ''
print 'Script failed executing'
}
print ''
# Must press enter to close terminal window
input 'Press Enter to exit'
"
}
def main [script:string] {
run-in-terminal (get-terminal-code $script)
}
- Create the Nemo action file and in the file, replace
/path/to/run-in-terminal.nuwith the path to therun-in-terminal.nufile...
~/.local/share/nemo/actions/nushell.nemo_action
[Nemo Action]
Name=Run in Terminal
Comment=Execute script in Terminal
Exec=nu /path/to/run-in-terminal.nu %F
Icon-Name=terminal
Selection=Single
Extensions=nu;
Now simply right click on any Nushell script file (.nu) in Nemo and you will see an option Run In Terminal.
Simple Nushell Script To Always Disable Laptop Internal Monitor When Using AR Glasses
7d 42m ago by lemmy.world/u/trymeout in nushell@programming.devThis week in Nushell #334
4mon 1d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.shThis week in Nushell #332
5mon 12d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.shThis week in Nushell #323
5mon 21d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.shThis week in Nushell #330
5mon 29d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.shThis week in Nushell #329
6mon 4d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.shNushell 0.109.1
6mon 16d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.shThis week in Nushell #327
6mon 20d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.shNushell 0.105.0 | Nushell
1y 11d ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.shNushell 0.104.1 | Nushell - Windows Installer Fixes
1y 3h ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.shThis Week in Nushell #297 | Nushell
1y 1mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.shThis Week in Nushell #296
1y 1mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.shNushell 0.104.0 Release
1y 1mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.shStarship v1.23.0 Offers Nushell Completions
1y 1mon ago by programming.dev/u/Kissaki in nushell@programming.dev from github.comThis week in Nushell #293
1y 2mon ago by lemm.ee/u/neme in nushell@programming.dev from www.nushell.shNushell 0.103.0 | Nushell
1y 2mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.shFixup of Missing Markdown Date Front Matter From Git with Nushell
1y 4mon ago by programming.dev/u/Kissaki in nushell@programming.dev from kcode.deFizzBuzz in Nu - Rosetta Code, side-by-side Programming Language Solutions
1y 4mon ago by programming.dev/u/Kissaki in nushell@programming.dev from rosettacode.orgNushell 0.102.0 | Nushell
1y 4mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.shGitHub Actions Workflow for testing Nushell env and config files
1y 5mon ago by programming.dev/u/Kissaki in nushell@programming.dev from github.comNushell 0.101.0 | Nushell
1y 5mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.shNushell CLI command to download the highest-quality opus audio file through yt-dlp
1y 7mon ago by programming.dev/u/Kissaki in nushell@programming.dev from kcode.deNushell - A Great Shell (Command Line)
1y 7mon ago by programming.dev/u/Kissaki in nushell@programming.dev from kcode.deNushell 0.100.0 | Nushell
1y 7mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh

