Commit graph

58 commits

Author SHA1 Message Date
Loric ANDRE 65ba8cffaa feat: event-driven re-render (#949) 2026-02-16 11:05:33 +01:00
kimono-koans ad91558749
feat: use a separate thread pool for Matcher runs (#961)
* Initial commit

* Disable Matcher when query is empty

* Revert

* Cleanup

* Use par_chunks for faster search

* Cleanup

* Skip updating atomic on every iter

* Item index unnecessary?

* Cleanup

* Build thread pool at App level

* Initial commit

* Disable Matcher when query is empty

* Revert

* Cleanup

* Use par_chunks for faster search

* Cleanup

* Skip updating atomic on every iter

* Item index unnecessary?

* Cleanup

* Build thread pool at App level

* Make suggested improvements

* chore: cleanup after rebase

* refactor: rewrite insta test harness to use fine-grained Skim:: methods

Split `impl Skim` into a generic `impl<Backend> Skim<Backend>` block so
that `Skim::init()`, `Skim::start()`, `Skim::tick()`, etc. work with
any backend, not just the default CrosstermBackend.

New public API on Skim<B>:
- `init_tui_with(tui)` – inject a caller-provided TUI (e.g. TestBackend)
- `app()` / `app_mut()` – access the application state
- `tui_ref()` / `tui_mut()` – access the TUI
- `app_and_tui()` – simultaneous mutable access to both (avoids borrow
  conflicts in render and handle_event calls)
- `final_event()` – inspect the quit event

TestHarness now wraps `Skim<TestBackend>` and initializes via
`Skim::init()` + `Skim::init_tui_with()`, sharing the production
init path (theme, reader, command expansion) instead of duplicating it.

https://claude.ai/code/session_016PtHKc9YVEpHftDxG5Nger

* chore: make insta harness more realistic

* Cleanup merge errors

* Remove duplicate check

* Cleanup

* No need to clone twice

* fix: fix thread pool race condition

---------

Co-authored-by: Loric ANDRE <loric.andre@pm.me>
Co-authored-by: Claude <noreply@anthropic.com>
2026-02-15 17:34:46 +01:00
kimono-koans 5d9743f198
feat: further reduce DefaultSkimItem size (#967)
* Initial commit

* Cleanup

* Prevent some double allocation behavior

* User the proper conversion method

* Further attempt to avoid alloc

* Actually avoid alloc

* Cleanup

* Remove an unnecessary alloc

* Cleanup

* Avoid another alloc

---------

Co-authored-by: LoricAndre <57358788+LoricAndre@users.noreply.github.com>
2026-02-13 15:18:26 +01:00
LoricAndre 98a9184055
feat: add set-preview-cmd action to change preview (#969)
* feat: add set-preview-cmd action to change preview

* chore: update manpage

* chore: generate completions & manpage

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-02-13 08:32:13 +00:00
LoricAndre de7eab7619
feat(cli): add SKIM_OPTIONS_FILE (#972)
* feat(cli): add SKIM_OPTIONS_FILE

* chore: generate completions & manpage

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-02-13 09:24:05 +01:00
Loric ANDRE 4c12048762 fix: restart_matcher race condition (closes #970) 2026-02-12 15:08:37 +01:00
LoricAndre e9fb1877c0
feat(lib): add fine-grained control over skim's event loop (#968)
* feat(lib): add fine-grained control over skim's event loop

* fix: do not panic on reload

* fix: cleaner handling of reload
2026-02-12 11:57:02 +01:00
Loric ANDRE d11e627ba6 feat!: use smarter setters, remove the need for Some(...) and String::from() in setters 2026-02-11 18:18:35 +01:00
dependabot[bot] d48f3f5e32
chore(deps): bump rand from 0.9.2 to 0.10.0 (#958)
Bumps [rand](https://github.com/rust-random/rand) from 0.9.2 to 0.10.0.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/rand_core-0.9.2...0.10.0)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 21:51:42 +00:00
Loric ANDRE fdd93644b4 chore: test matchers 2026-02-09 23:31:43 +01:00
LoricAndre a08f6ac9b3
feat!: interactive pty preview & concurrency optimizations (#952)
This PR has grown beyond its initial scope due to me over-optimizing everything, but it leads to:

    Paving the way for future actually interactive previews
    Consistently better performance than fzf in our bench thanks to thread and concurrency optimizations as well as the use of kanal for the items channels

Given the scope, I'm marking this as breaking because:

    setting wrap in the preview window layout disables the pty since we don't want to manipulate the raw buffer to word-wrap it manually
    kanal channels work slightly differently and might break library usage, even though switching to them did not require any modifications of the examples so it's unlikely that users will see anything break


* fix: force cwd for preview

* fix: correctly set cwd & kill pty child in the right order

* fix: use std threads & reopen new pty for each preview

* feat: use tui-term for displaying

* feat: scroll in pty

* fix: make nested skim previews work

* fix: clippy mistake

* feat: reactive preview triggering

* chore: generate completions & manpage

* chore: optimizations & thread cleanup

* chore: use kanal for faster channels

* fix: tests

* fix: only send items if the matcher hasn't been killed in the meantime (#947)

* tests: add coverage

* tests: fix bin path with coverage

* tests: upload tests to codecov

* chore: make pty opt-in through preview-window

* chore: generate completions & manpage

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-02-09 21:43:04 +00:00
LoricAndre ee0d6dcd19
fix(linux): run preview in a PTY (closes #894) (#897)
* Reapply "fix: run preview in a PTY (closes #894)"

This reverts commit c5eb948500.

* chore: use pty only on linux

* chore: add test
2026-02-01 15:57:41 +01:00
Loric ANDRE d45f4c41fe fix: always make ctrl-d abort (closes #941) 2026-01-29 18:23:10 +01:00
LoricAndre 55b50cb3bf
feat: add --normalize to ignore accents etc. when matching (closes #453) (#914)
* feat: add `--normalize` to ignore accents etc. when matching (closes #453)

* chore: generate completions & manpage

* chore: merge master

* chore: generate completions & manpage

* chore: use a matcher engine for normalization

* chore: reset useless changes

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-01-27 14:04:51 +00:00
phanium a99cae3ca2
fix: clear screen when not in fullscreenon bash & fish (#936)
* fix: clear screen when not in fullscreen

`SKIM_DEFAULT_OPTIONS= sk --height=90%` don't clear screen on exit.

It don't use alt screen so we clear the screen manually on exit.

* fixup! fix: clear screen when not in fullscreen

* test: use explicit escape key and move to platform-specific

---------

Co-authored-by: Loric ANDRE <loric.andre@pm.me>
2026-01-27 09:51:20 +00:00
Loric ANDRE 5eb9703547 feat: parse ansi codes in prompt 2026-01-26 13:37:32 +01:00
LoricAndre 5d938b05fe
fix: make select-1 and exit-0 work again (closes #916) (#933) 2026-01-26 13:14:51 +01:00
Loric ANDRE 788eb81334 tests: review snapshots 2026-01-25 21:56:28 +01:00
Loric ANDRE 6a6fea3e3a fix: header and header-lines order in reverse layout 2026-01-25 21:40:30 +01:00
Loric ANDRE 94c4bd51fe fix: correct cursor position when using reverse and border (closes #928) 2026-01-25 19:25:42 +01:00
Loric ANDRE 7ff7b01031 fix: correctly compute character width for cursor display (closes #929) 2026-01-25 10:41:57 +01:00
LoricAndre ec0658a9d4
feat: add borders to all widgets (#930) 2026-01-25 10:36:28 +01:00
Loric ANDRE a6613e4559 fix: re-enable query/cmd-query distinction and switching 2026-01-24 16:47:55 +01:00
Loric ANDRE 505c5deae7 fix: correctly toggle prompt on ToggleInteractive (closes #925) 2026-01-24 11:06:00 +01:00
LoricAndre 1536eb9657
feat: add --remote flag to call remote (--listen) instances (#915)
* feat: add `--remote` flag to call remote (`--listen`) instances

* chore: generate completions & manpage

* docs: update docs

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-01-23 18:19:43 +00:00
Loric ANDRE 47e547a9ad tests: remove insta_ prefixes after finalizing tests migration 2026-01-23 17:58:05 +01:00
Loric ANDRE 96a4c69646 fix: correctly merge styles & do not reset them by default (#918) 2026-01-23 11:50:44 +01:00
Loric ANDRE 16ef0f4a27 fix: do not override {} with {q} in interactive mode 2026-01-22 21:34:40 +01:00
Mathieu Lemay 554896db64
fix: Escape last ; in env var value before passing to tmux (#912)
* fix: Escape last ; in env var value before passing to tmux

* Use shell_quote for more robust quoting

* Use Sh quoting always

* Revert to original escaping, add test

---------

Co-authored-by: LoricAndre <57358788+LoricAndre@users.noreply.github.com>
2026-01-22 16:49:18 +00:00
LoricAndre 3c5b2d4209
fix: correctly expand {+} to current when no items are selected (cl… (#913)
* fix: correctly expand `{+}` to current when no items are selected (closes #910)

* chore: generate completions & manpage

* test: add printf_plus unit tests

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-01-22 11:28:58 +00:00
Loric ANDRE 662e92f835 fix: make case option work with non-ascii input (closes #454) 2026-01-22 00:12:18 +01:00
LoricAndre 79672e348f
feat: add set-query action to update the input (closes #657) (#907)
* feat: add `set-query` action to update the input (closes #657)

* chore: generate completions & manpage

* test: add set_query tests

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-01-21 22:42:26 +00:00
LoricAndre 1ee19d3caa
feat: split-match (#906)
* wip: split-match

* chore: generate completions & manpage

* chore: use engine factory for split match

* chore: generate completions & manpage

* docs: update README.md with new option [skip ci]

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-01-21 18:35:30 +01:00
LoricAndre 6d0c310bea
test: use insta for applicable integration tests, making them cross-p… (#903)
* test: use insta for applicable integration tests, making them cross-platform

* fix: remove @cmd from insta tests

* fix: remove @cmd from insta tests

* fix: use printf instead of echo
2026-01-21 15:41:20 +01:00
Loric ANDRE 6848e5afb6 fix: allow layout to override reverse (closes #901) 2026-01-21 09:15:47 +01:00
LoricAndre 4d4a33542d
feat: add no-strip-ansi flag (#898)
* feat: add no-strip-ansi flag

* chore: generate completions & manpage

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-01-20 14:31:41 +01:00
Loric ANDRE 52bf6a247b fix: use ansi-stripped raw item in preview expansion 2026-01-20 09:48:06 +01:00
Loric ANDRE 102f7c79f2 test: fix preview_nul 2026-01-19 22:59:48 +01:00
Loric ANDRE 9d486b78fa fix: use item output for fields 2026-01-19 22:55:48 +01:00
LoricAndre f03894c25b
test: fix wrap test (#896)
* test: fix wrap test

* chore: generate completions & manpage

* fix: fix test

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-01-19 21:17:42 +01:00
Loric ANDRE 33833ff5a6 fix: preview on large binaries does not hang or mangle the tui 2026-01-19 19:42:48 +01:00
Loric ANDRE 3e0cbd1e06 feat: wrap items 2026-01-19 17:17:13 +01:00
Loric ANDRE d17f5bd95d test: fix flaky tests 2026-01-17 19:39:24 +01:00
Loric ANDRE 8e25217a01 fix: matcher race condition at startup 2026-01-17 00:19:59 +01:00
Loric ANDRE f608ef9d24 feat: add print-header flag (and readd print-score) (closes #470) 2026-01-16 23:34:30 +01:00
Loric ANDRE 7c9b7194e0 test: remove useless listen tests 2026-01-16 22:32:58 +01:00
LoricAndre e25e166003
fix(ui): use current highlight for the current item (closes #889) (#890)
* fix(ui): use current highlight for the current item (closes #889)

* fix: misc
2026-01-16 17:54:02 +01:00
Loric ANDRE 577025224e fix: correctly parse wrap arg in preview options 2026-01-16 16:27:20 +01:00
LoricAndre 3782ae85e1
fix: fix listen flag on macos (#888)
* test: add vanilla test

* test: add vanilla test

* test: add vanilla test

* chore: better error

* fix: @dbg never times out

* chore: increase timeout

* chore: increase timeout

* fix: allow listen tests to retry
2026-01-16 15:58:07 +01:00
Loric ANDRE 1bf7b5266a test: add tests for listen flag 2026-01-16 10:01:28 +01:00