1
1
mirror of https://github.com/ellie/atuin.git synced 2024-09-17 16:07:18 +03:00

fix: pass search query in via env for *Nushell* (#1874)

This commit is contained in:
Steven Xu 2024-03-14 02:37:51 +11:00 committed by GitHub
parent da8cc48198
commit ad766cc82d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,10 +35,12 @@ def _atuin_search_cmd [...flags: string] {
[
$ATUIN_KEYBINDING_TOKEN,
([
(if $nu_version.0 <= 0 and $nu_version.1 <= 90 { 'commandline' } else { 'commandline edit' }),
`(ATUIN_LOG=error run-external --redirect-stderr atuin search`,
($flags | append [--interactive, --] | each {|e| $'"($e)"'}),
`(commandline) | complete | $in.stderr | str substring ..-1)`,
`with-env { ATUIN_LOG: error, ATUIN_QUERY: (commandline) } {`,
(if $nu_version.0 <= 0 and $nu_version.1 <= 90 { 'commandline' } else { 'commandline edit' }),
`(run-external --redirect-stderr atuin search`,
($flags | append [--interactive] | each {|e| $'"($e)"'}),
` | complete | $in.stderr | str substring ..-1)`,
`}`,
] | flatten | str join ' '),
] | str join "\n"
}