Files
jjf/src/init/nu.nu
T
swaits 8605528960 feat(ux): batch UX improvements
- Reverse-video caret in input row (was cyan █ block — collided with
  the cyan ❯ prompt and read as 'unfocused-pane cursor')
- Synchronized-output brackets (DEC mode 2026) around each redraw —
  eliminates tearing on Kitty/WezTerm/foot/recent iTerm; ignored elsewhere
- Two-tone hint row (keys at normal weight, labels dim) gives the eye
  a scan anchor
- Dim header above preview pane (── <change_id> ────) anchors the right
  column to the cursor row's revision
- Light-terminal detection via COLORFGBG: switch cursor-row highlight
  from indexed-237 dark-gray bg to reverse-video on themes where the
  dark bg would be invisible
- Shell wrappers echo the resolved 'jj …' command (dim '$' prefix)
  before running it, so it's visible in scrollback
2026-04-29 16:29:01 -06:00

18 lines
707 B
Nu

def --env jjf [...args] {
# No args → default to `show` so `jjf` alone is a rev browser.
let args = if ($args | is-empty) { ["show"] } else { $args }
# Meta-commands and bare flags bypass the picker and run the binary directly.
let first = $args.0
if $first == "init" or ($first | str starts-with "-") {
^jjf ...$args
return
}
let result = (^jjf --emit ...$args | complete)
if $result.exit_code != 0 { exit $result.exit_code }
let cmd = ($result.stdout | str trim)
if ($cmd | is-empty) { exit 130 }
[{command: $cmd, start_timestamp: (date now | format date "%+")}] | history import
print $"(ansi grey)$(ansi reset) ($cmd)"
^sh -c $cmd
}