nu: Add job control shortcuts

Using <c-z> when a process is running backgrounds it (default behavior)
using the new nushell job control system (since v0.103).
This change also lets you re-foreground the backgrounded program with
the same <c-z> key mapping.

Additionally we add the `fg` alias which does the same and thus mimics
the fg command of other shells like zsh.
This commit is contained in:
Marty Oehme 2025-11-14 14:02:03 +01:00
parent 37cc1a3d83
commit 26e8cc3ccc
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -119,6 +119,17 @@ $env.config.keybindings = [
" "
} }
} }
# job control
{
name: unfreeze_job
modifier: control
keycode: char_z
mode: ["emacs", "vi_normal", "vi_insert"]
event: {
send: executehostcommand
cmd: "job unfreeze"
}
}
] ]
alias l = ls alias l = ls
@ -131,3 +142,6 @@ def --env mcd [path: path] {
} }
alias v = nvim alias v = nvim
# requires minimum nushell: 0.103 for job control
alias fg = job unfreeze