working onefetch in nu

This commit is contained in:
Daniel Bulant 2025-04-06 22:32:10 +02:00
parent 5e134559ff
commit 397ff8381f
No known key found for this signature in database

View file

@ -288,7 +288,14 @@ export-env {
pre_prompt: [{ null }] # run before the prompt is shown
pre_execution: [{ null }] # run before the repl input is run
env_change: {
PWD: [{ |before, after| if (ls -la | where name == ".git" | is-not-empty) { onefetch } }] # run if the PWD environment is different since the last repl input
PWD: [{
|before, after|
# runs on startup
if (($before | is-not-empty) and (ls -la | where name == ".git" | is-not-empty)) {
# output to stdout in hooks is unreliable, use `print`
print (onefetch)
}
}]
}
display_output: { table } # run before the output of a command is drawn, example: `{ if (term size).columns >= 100 { table -e } else { table } }`
command_not_found: { null } # return an error message when a command is not found