Skip to content

feat(flash): command history#556

Merged
idursun merged 3 commits intomainfrom
feat/command-history
Feb 27, 2026
Merged

feat(flash): command history#556
idursun merged 3 commits intomainfrom
feat/command-history

Conversation

@idursun
Copy link
Copy Markdown
Owner

@idursun idursun commented Feb 26, 2026

I was trying to simplify status.go so decided to move the running command information to the flash system so that the command and its output are presented close to each other. (which I think is much better overall).

Then I noticed I am not far off from implementing command history. Here's how it looks at the moment:

command_history.mp4

I bound opening command history to W (which is up for debate). I think it looks visually OK but I might be biased.

I've been using this for the last couple of days and I already like the experience. I am opening the PR to collect some feedback.

fixes #243

Pressing `W` opens the command history (only including command executions).

Additionally, showing the currently running command has been moved out of status and to flash model.
@idursun idursun mentioned this pull request Feb 27, 2026
@seh
Copy link
Copy Markdown

seh commented Feb 27, 2026

I am opening the PR to collect some feedback.

Having watched the video a couple of times, I found the overlays to be distracting and confusing, with them stacking up and going away, making it difficult to tell what it all "meant". Perhaps if I were controlling it with the keyboard myself I would be able to interpret the effects of navigating and deleting the entries.

I expected to see a keybinding for repeating an operation, though I suppose that there aren't too many operations performed in jjui that warrant repeating exactly later.

Copy link
Copy Markdown
Collaborator

@baggiiiie baggiiiie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its output are presented close to each other. (which I think is much better overall).

totally, this is much nicer

visually, i think a different color to indicate current selection migth be better than double border.

on a side note, i personally craved for this command history feature before when first coming from lazygit. but i have realized it's a crutch that i don't need. wondering what people use it for now

@idursun
Copy link
Copy Markdown
Owner Author

idursun commented Feb 27, 2026

@seh @baggiiiie Thanks for the feedback!

I expected to see a keybinding for repeating an operation, though I suppose that there aren't too many operations performing in jjui that warrant repeating exactly later

Exactly. Never occurred to me that this could be useful, I don't think it would ever. I'd recommend repeating the command using the operation again instead of running it from the command history.

Command history is useful when you want to see the output for a little bit longer (e.g. which branches are deleted/created, PR link of a git push, etc)

i think a different color to indicate current selection migth be better than double border.

I will have a look at this. There's too much green at the moment, toning it down might look better.

@idursun
Copy link
Copy Markdown
Owner Author

idursun commented Feb 27, 2026

Ok, I had tried dim effect previously (before the bubbletea v2 migration) and it didn't look great back then. Specifically, faint=true style didn't apply uniformly to all screen cells but seems like it this is fixed in v2. It looks like this now and I think this is even better (notice that the rest of the UI is washed out)

image

I will push new commits to this branch but this look only appears once the v2 branch is merged.

@locksten
Copy link
Copy Markdown

I really like the running command indicator being more prominent – it was easy to miss before.
The dimmed background definitely looks nice.
I thought keeping the titles right-aligned while scrolling through history would be nicer, though after making a mock screenshot I'm not sure 🤔. It might be better to keep it consistently left-aligned.

jjui align

@nickchomey
Copy link
Copy Markdown
Contributor

This looks really nice. Like others said, at first, I couldnt figure out the use case - you can't replay them. But why would you even want to? Its nice being able to see the history, particularly for when you want to inspect the command that was run for a complicated action.

@idursun
Copy link
Copy Markdown
Owner Author

idursun commented Feb 27, 2026

Thanks @nickchomey @locksten

I think I am going to ship this as is.

One nice addition to this might be copying the output to the clipboard. (maybe pressing y) but you can still do this today by shift dragging. We can think about it later.

@idursun idursun merged commit 109abcb into main Feb 27, 2026
4 checks passed
@idursun idursun deleted the feat/command-history branch February 27, 2026 22:16
@nickchomey
Copy link
Copy Markdown
Contributor

Yeah, I'd say ship it.

If you do add a copy feature, I think it should only copy the command.

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 11, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [idursun/jjui](https://github.com/idursun/jjui) | minor | `v0.9.12` → `v0.10.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>idursun/jjui (idursun/jjui)</summary>

### [`v0.10.0`](https://github.com/idursun/jjui/releases/tag/v0.10.0)

[Compare Source](idursun/jjui@v0.9.12...v0.10.0)

Wow, a major release after a very long time. As promised, `v0.10` is ready, and it comes with **breaking changes**.

First, thank you to everybody who contributed code, bug reports, ideas, and testing for this release. In particular, thanks to [@&#8203;baggiiiie](https://github.com/baggiiiie) for various features and fixes, [@&#8203;nickchomey](https://github.com/nickchomey) for contributions and continuous feedback, and [@&#8203;vic](https://github.com/vic) for updating the documentation website. Thanks as well to everyone else for various code contributions, reporting issues, and verifying fixes.

We changed a lot in `v0.10`, but the biggest shift is that we finally got rid of some **legacy configuration** and moved to a unified **actions + bindings** model. Old concepts like `[custom_commands]` and `[leader]` are now replaced by a more consistent system built around **actions**, **bindings**, and first-class support for leader-style key sequences.

This release also introduces `config.lua`, which makes it much easier to customise and extend `jjui` with **real scripting** instead of only static configuration. Between `config.toml`, `config.lua`, Lua actions, and bindings, much more of the UI can now be customised in one consistent way.

The documentation has been updated with [**migration notes**](https://idursun.github.io/jjui/migrating/v0_10/) and examples such as the [**Lua Cookbook**](https://idursun.github.io/jjui/lua-cookbook/).

From my testing it looks ready, but I am sure more rough edges will show up once more people start using it, so please keep reporting issues as you find them.

#### ⚠️ Breaking Changes

`v0.10` replaces the **legacy keybinding and customisation model** with the new **actions + bindings** system.

- `[keys]` configuration is no longer used.
- `[custom_commands]` is replaced by `[[actions]]` and `[[bindings]]`.
- `[leader]` sequences are replaced by sequence bindings via `seq`.

If you have an existing configuration, plan to **migrate it** rather than expecting a drop-in upgrade from `v0.9.x`.

#### ✨Highlights

- **Unified actions + bindings system.** Keyboard input now flows through a single dispatch pipeline, default bindings are declared in TOML, actions are discoverable, and custom behaviour can be defined in both TOML and Lua.
- **Much stronger scripting support.** Lua `setup` now receives the full config plus runtime context, generated intent-backed actions replace handwritten drift-prone bridges, and new helpers like `wait_close()` and `wait_refresh()` make multi-step scripts more predictable.
- **Upgraded TUI foundations.** Moving from **Bubble Tea v1** to **v2** brings better terminal support, a new rendering engine for better performance, and better input handling, including support for bindings like `ctrl+space` and dedicated `shift+...` style keys.
- **Improved diff and selection workflows.** The `diff` view now supports word wrap, `revisions` and `details` support modifier-based mouse selection, and several `details` and `evolog` interactions are more consistent.

#### 🚀 New and Improved

##### Command History

- Added [**command history**](https://idursun.github.io/jjui/command-history/), available with `shift+w`, to review dismissed command runs together with their output.
- Moved **running command** information out of the status area and into dedicated `flash` messages, so the command and its output are now shown together in one place.

##### Help and Status

- Reintroduced a dedicated **Help view** for full keybinding discovery, with filtering and scrolling, alongside the existing inline help.
- Changed **status/help** binding presentation to **column-major order** so related bindings are easier to scan.

##### Lua and Configuration

- Shipped the unified **actions + bindings** architecture introduced in `v0.10`.
- Exposed the full config object to Lua `setup`, including runtime context such as repository path via `config.repo`, and terminal state via `config.terminal.dark_mode`, `config.terminal.fg`, and `config.terminal.bg`.
- Standardised closeable action naming around `open_*` and aligned apply/close semantics for more predictable scripted workflows.

##### Oplog

- Added **quick search** to `oplog` and shared the search behavior with revision search.

##### Evolog

- Changed `evolog` preview defaults to show **interdiff** output, matching `jj evolog -p` more closely.

##### Abandon

- Added `s` in `abandon` mode to target descendants of the selected revision(s).

##### Revset

- Kept `revset` editing open when the expression is invalid, improving iteration while editing.
- Improved `revset` editing so function completion inserts `(` when appropriate, while the function list display is cleaner and less noisy.

##### Diff

- Added **word wrap** in the `diff` view, with explicit wrapped and unwrapped modes plus soft-wrap-aware scrolling.
- Added `g` and `G` in the `diff` view to jump to the top and bottom.

##### Details and Revisions

- Added `Ctrl+click` single-item toggle and `Alt+click` range selection in `revisions` and `details`.
- Added a `revisions.details.select_file` action for finer control in `details` workflows.

#### 🛠️ Fixes

- Fixed rendering issues with **double-width characters**.
- Simplified divergent revision handling by using `change_id/offset` directly from the `jj log` prefix template.
- Fixed `git push --all` behaviour for deleted bookmarks and corrected related command descriptions.

#### ⚙️ Internal Updates

- Upgraded to **Bubble Tea v2**.
- Replaced remaining `cellbuf` usage with `ultraviolet`.
- Hardcoded model-level key handling has been removed in favor of dispatcher-driven intents.
- Continued internal cleanup around rendering, overlays, display context, and generated action plumbing to support the new architecture.

#### What's Changed

- Unified Actions + Bindings system by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;533](idursun/jjui#533)
- feat(oplog): add QuickSearch to oplog, share logic with revision search by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;521](idursun/jjui#521)
- fix: add missing keys in bindings by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;538](idursun/jjui#538)
- feat(evolog): change default evolog command to show interdiff by [@&#8203;academician](https://github.com/academician) in [#&#8203;539](idursun/jjui#539)
- fix: add back `esc` to clear checked revisions by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;541](idursun/jjui#541)
- remove gh-pages workflow from main branch. by [@&#8203;vic](https://github.com/vic) in [#&#8203;542](idursun/jjui#542)
- docs: fix readme links by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;549](idursun/jjui#549)
- Update CONTRIBUTING.md for documentation by [@&#8203;vic](https://github.com/vic) in [#&#8203;547](idursun/jjui#547)
- feat(lua): add "filter" and "ordered" option to `choose` lua api by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;548](idursun/jjui#548)
- feat(abandon): use `s` for selecting descendants by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;544](idursun/jjui#544)
- feat: add change\_offset in jj log prefix template for divergent revisions by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;550](idursun/jjui#550)
- fix: make bookmark input visible when user has custom template-aliases by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;551](idursun/jjui#551)
- fix(evolog): keep restore mode navigation on revisions and esc close by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;554](idursun/jjui#554)
- Expose full config to Lua setup and add runtime context (repo + terminal) by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;553](idursun/jjui#553)
- feat(flash): command history by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;556](idursun/jjui#556)
- Update to bubbletea v2 by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;558](idursun/jjui#558)
- Ctrl+click and Alt+click for single and range selection by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;563](idursun/jjui#563)
- feat: add `(` to functions when autocompleted by [@&#8203;nickchomey](https://github.com/nickchomey) in [#&#8203;564](idursun/jjui#564)
- feat(status): change display to column major order by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;569](idursun/jjui#569)
- fix: remove parentheses from functions list, but add when autocomplete by [@&#8203;nickchomey](https://github.com/nickchomey) in [#&#8203;567](idursun/jjui#567)
- fix(git): prevent panic when opening git menu with no selected revision by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;571](idursun/jjui#571)
- Refactor/Lua bridge by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;572](idursun/jjui#572)
- fix(ui): guard against nil commit in OpenBookmarks intent by [@&#8203;baggiiiie](https://github.com/baggiiiie) in [#&#8203;573](idursun/jjui#573)
- feat(diff): word wrap by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;575](idursun/jjui#575)
- Add pgup/pgdown keybindings to evolog and details by [@&#8203;academician](https://github.com/academician) in [#&#8203;576](idursun/jjui#576)
- feat(lua): make default actions overridable and expose jjui.builtin.\* by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;577](idursun/jjui#577)
- feat(help): add "help view" bound to `f1` by [@&#8203;idursun](https://github.com/idursun) in [#&#8203;578](idursun/jjui#578)

#### New Contributors

- [@&#8203;academician](https://github.com/academician) made their first contribution in [#&#8203;539](idursun/jjui#539)

**Full Changelog**: <idursun/jjui@v0.9.12...v0.10.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41OS40IiwidXBkYXRlZEluVmVyIjoiNDMuNTkuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IP: Have a way to see previously closed flash notifications.

5 participants