0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-10-16 03:35:36 +00:00
Files
termux-packages/packages/nushell/command-not-found.nu
Juhan a07ba9cb39 fix(main/nushell): fix command-not-found integration (#26224)
Previously it would override any previously set command_not_found hook
by the user (or any other program). Now it just adds a new hook
alongside the previous hook
2025-09-11 21:49:54 +08:00

13 lines
405 B
Nu

do --env {
# Handles nonexistent commands.
# If user has entered command which invokes non-available
# utility, command-not-found will give a package suggestions.
let cnf = '@TERMUX_PREFIX@/libexec/termux/command-not-found'
if ($cnf | path exists) {
$env.config.hooks.command_not_found = $env.config.hooks.command_not_found
| default [] | append {|cmd|
run-external $cnf $cmd | print
}
}
}