mirror of
https://github.com/RGBCube/ncc
synced 2025-07-29 02:57:44 +00:00
feat: _ command for nushell for retrieving the last command
This commit is contained in:
parent
e2c62cf970
commit
5d84c43a0c
1 changed files with 16 additions and 4 deletions
|
@ -158,9 +158,15 @@ $env.config.cursor_shape = {
|
|||
|
||||
$env.config.hooks = {
|
||||
command_not_found: {||}
|
||||
display_output: "table --expand"
|
||||
env_change: {}
|
||||
pre_execution: [
|
||||
|
||||
display_output: {
|
||||
tee { table --expand | print }
|
||||
| $env.last = $in
|
||||
}
|
||||
|
||||
env_change: {}
|
||||
|
||||
pre_execution: [
|
||||
{
|
||||
let prompt = commandline | str trim
|
||||
|
||||
|
@ -171,7 +177,13 @@ $env.config.hooks = {
|
|||
print $"(ansi title)($prompt) — nu(char bel)"
|
||||
}
|
||||
]
|
||||
pre_prompt: []
|
||||
|
||||
pre_prompt: []
|
||||
}
|
||||
|
||||
# Retrieve the output of the last command.
|
||||
def _ []: nothing -> any {
|
||||
$env.last
|
||||
}
|
||||
|
||||
$env.config.menus = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue