mirror of
https://github.com/RGBCube/ncc
synced 2025-07-30 03:27:45 +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,8 +158,14 @@ $env.config.cursor_shape = {
|
||||||
|
|
||||||
$env.config.hooks = {
|
$env.config.hooks = {
|
||||||
command_not_found: {||}
|
command_not_found: {||}
|
||||||
display_output: "table --expand"
|
|
||||||
|
display_output: {
|
||||||
|
tee { table --expand | print }
|
||||||
|
| $env.last = $in
|
||||||
|
}
|
||||||
|
|
||||||
env_change: {}
|
env_change: {}
|
||||||
|
|
||||||
pre_execution: [
|
pre_execution: [
|
||||||
{
|
{
|
||||||
let prompt = commandline | str trim
|
let prompt = commandline | str trim
|
||||||
|
@ -171,9 +177,15 @@ $env.config.hooks = {
|
||||||
print $"(ansi title)($prompt) — nu(char bel)"
|
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 = [
|
$env.config.menus = [
|
||||||
{
|
{
|
||||||
marker: "| "
|
marker: "| "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue