Nushell

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.nu with the path to the run-in-terminal.nu file...

~/.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.dev
702

Nushell 0.112.1

2mon 6d ago by quokk.au/u/f in nushell@programming.dev from www.nushell.sh
303

Nushell 0.110.0

4mon 9h ago by quokk.au/u/f in nushell@programming.dev from www.nushell.sh
304

This week in Nushell #334

4mon 1d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.sh
505

This week in Nushell #332

5mon 12d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.sh
306

This week in Nushell #323

5mon 21d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.sh
407

This week in Nushell #330

5mon 29d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.sh
308

This week in Nushell #329

6mon 4d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.sh
409

Nushell 0.109.1

6mon 16d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.sh
7010

This week in Nushell #327

6mon 20d ago by mander.xyz/u/nemeski in nushell@programming.dev from www.nushell.sh
5011

Nushell 0.109.0

6mon 20d ago by quokk.au/u/f in nushell@programming.dev from www.nushell.sh
6312

Nushell 0.108.0

8mon 4d ago by quokk.au/u/f in nushell@programming.dev from www.nushell.sh
7113

Nushell 0.107.0

9mon 15d ago by quokk.au/u/f in nushell@programming.dev from www.nushell.sh
9014

Nushell 0.105.0 | Nushell

1y 11d ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh
8115

Nushell 0.104.1 | Nushell - Windows Installer Fixes

1y 3h ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh
4016

This Week in Nushell #297 | Nushell

1y 1mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh
4017

This Week in Nushell #296

1y 1mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh
4018

Nushell 0.104.0 Release

1y 1mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh
6519

Starship v1.23.0 Offers Nushell Completions

1y 1mon ago by programming.dev/u/Kissaki in nushell@programming.dev from github.com
3020

This week in Nushell #293

1y 2mon ago by lemm.ee/u/neme in nushell@programming.dev from www.nushell.sh
2121

Nushell 0.103.0 | Nushell

1y 2mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh
6022

Fixup of Missing Markdown Date Front Matter From Git with Nushell

1y 4mon ago by programming.dev/u/Kissaki in nushell@programming.dev from kcode.de
5023

FizzBuzz in Nu - Rosetta Code, side-by-side Programming Language Solutions

1y 4mon ago by programming.dev/u/Kissaki in nushell@programming.dev from rosettacode.org
6024

Nushell 0.102.0 | Nushell

1y 4mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh
8125

GitHub Actions Workflow for testing Nushell env and config files

1y 5mon ago by programming.dev/u/Kissaki in nushell@programming.dev from github.com
3026

Nushell 0.101.0 | Nushell

1y 5mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh
9027

Nushell 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.de
7028

Nushell - A Great Shell (Command Line)

1y 7mon ago by programming.dev/u/Kissaki in nushell@programming.dev from kcode.de
6029

Nushell 0.100.0 | Nushell

1y 7mon ago by programming.dev/u/Kissaki in nushell@programming.dev from www.nushell.sh
6030