Skip to content

Commit

Permalink
refactor(nushell): add backwards compatibility for *Nushell* v0.90.x
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenxxiu committed Feb 19, 2024
1 parent 1b188be commit f82189a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion atuin/src/shell/atuin.nu
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ let _atuin_pre_prompt = {||
}

def _atuin_search_cmd [...flags: string] {
let nu_version = ($env.NU_VERSION | split row '.' | each { || into int })
[
$ATUIN_KEYBINDING_TOKEN,
([
`commandline edit (ATUIN_LOG=error run-external --redirect-stderr atuin search`,
(if $nu_version.0 <= 0 and $nu_version.1 <= 91 { '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)`,
] | flatten | str join ' '),
Expand Down

0 comments on commit f82189a

Please sign in to comment.