Commit graph

44 commits

Author SHA1 Message Date
Loric ANDRE e929c512e3 fix(examples): gate malloc_trim to gcc in the multiple_runs example 2026-07-25 16:19:31 +02:00
LoricAndre bb6c03f377
feat: reduce binary size by removing uncommon image formats and color_eyre (#1118)
* Shrink binary: trim image decoders and swap color-eyre for eyre

Two dependency changes that cut the default `sk` binary from 13.6 MiB to
8.55 MiB (-5.06 MiB, -37%) with no loss of core functionality:

- image: build the `image` crate with only the common decoders (png,
  jpeg, gif, webp) instead of its full default format set, and drop
  ratatui-image's `image-defaults`. This removes AVIF encoding (ravif,
  avif-serialize), OpenEXR (exr), TIFF, QOI and other decoders that are
  irrelevant to terminal image previews. Previewing those formats now
  falls back to the normal command preview.

- error handling: replace color-eyre with plain eyre. color-eyre only
  provided colored panic/error backtraces; skim used none of its
  Section/Help extension APIs. This drops the backtrace/gimli/addr2line/
  color-spantrace stack. `color_eyre::install()` is no longer needed.

Tests, benches and examples are migrated from color_eyre to eyre so the
crate is fully removed from the dependency graph.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQtxeCS4gM7dumghqmNgST

* chore: fmt

* docs: ARCHITECTURE.md

* chore(flake): add cargo-bloat

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-17 17:29:43 +00:00
Loric ANDRE 0de1a2acbb chore: format imports 2026-06-17 13:58:44 +02:00
Loric ANDRE 42fa8e143b chore: add image tests & examples 2026-06-17 13:56:37 +02:00
Loric ANDRE c7860a1a16 chore: crate-level lints 2026-05-21 18:19:40 +02:00
Loric ANDRE 98f9612e97 fix: remove breaking change introduced with 7375d30b 2026-04-14 13:39:26 +02:00
LoricAndre ab514a54c9
feat!: internally compute indexes at match time (removes get/set_index) (#1001)
* chore: remove skim::Item run_items wrapper

* fix: properly trigger re-render on custom previews

* feat: add AppendItems event

* feat!: internally compute indexes at match time (removes get/set_index)

* chore: generate completions & manpage

* chore: better benchmarks

---------

Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
2026-03-10 14:12:10 +01:00
Loric ANDRE 9c9e15c97b feat: add Skim::run_items API 2026-03-08 18:46:12 +01:00
Loric ANDRE 5a56391190 feat: merge ranks in AndOr engine matcher 2026-02-23 14:45:09 +01:00
Loric ANDRE d87a6a34bf fix: make sure we drop Skim before returning the output 2026-02-22 16:51:56 +01:00
Loric ANDRE 5f1d49d997 chore: add rust benchmark 2026-02-18 15:54:50 +01:00
figsoda 2a7bd1db11
feat: allow run_with to be run within a tokio runtime (#979)
* feat: allow run_with to be run within a tokio runtime

* feat: add async example
2026-02-17 21:05:50 +00: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
Loric ANDRE 1b23121956 chore: update frizbee and nightly version 2026-02-11 10:00:56 +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 b96c65507e
feat!: send & receive items in batches (#938)
* feat!: send & receive items in batches

* fix: add timeout

* Revert "fix: matcher race condition at startup"

This reverts commit 8e25217a01.

* fix: correctly init matcher_control as stopped
2026-01-29 17:57:39 +00:00
Loric ANDRE c0a368b901 feat: add custom action for lib usage (closes #537) 2026-01-27 19:50:52 +01:00
Loric ANDRE 484eb6a75e release: v1.0.1 2026-01-19 12:21:48 +01:00
LoricAndre c364c5f128
chore: remove workspace (#883)
* chore: remove workspace

* chore: regen dist config

* fix: readme path

* chore: extra-artifacts as files

* chore: generate dist CI

* chore: prepare for prerelease

* chore: switch to include + generate-files

* chore: use run step for generate-files

---------

Co-authored-by: Loric André <loric.andre@noreply.me>
2026-01-13 11:34:10 +01:00
LoricAndre 7df8b77739
feat: use clap & derive for options, manpage & completions (#586)
Some checks failed
Build & Test / test (linux, ubuntu-latest, stable, x86_64-unknown-linux-musl) (push) Has been cancelled
Build & Test / test (macos, macos-latest, stable, x86_64-apple-darwin) (push) Has been cancelled
Build & Test / clippy (linux, ubuntu-latest, stable, x86_64-unknown-linux-musl) (push) Has been cancelled
Build & Test / clippy (macos, macos-latest, stable, x86_64-apple-darwin) (push) Has been cancelled
Build & Test / rustfmt (push) Has been cancelled
* feat: use clap & derive for options, manpage & completions

* clippy & fmt

* fix: correctly handle errors

* fix: disable doctest

* fix: readd replstr

* fix: reserve --tmux until it is implemented

* explicit panic messages for history files

* fix after merge

---------

Co-authored-by: LoricAndre <loric.andre@pm.me>
2024-11-20 17:01:08 +01:00
otto-dev 064b7b78e2
Return items of multi-select in order of selection (#468)
Some checks are pending
Build & Test / test (linux, ubuntu-latest, stable, x86_64-unknown-linux-musl) (push) Waiting to run
Build & Test / test (macos, macos-latest, stable, x86_64-apple-darwin) (push) Waiting to run
Build & Test / clippy (linux, ubuntu-latest, stable, x86_64-unknown-linux-musl) (push) Waiting to run
Build & Test / clippy (macos, macos-latest, stable, x86_64-apple-darwin) (push) Waiting to run
Build & Test / rustfmt (push) Waiting to run
* Return items of multi-select in order of selection

* chore: update deps and fix lots of clippy lints

* cargo update

* Fix more lints + ci

* Include repology reference

`skim` is packaged in more then the listed repositories. By referring to repology everyone can easily check whether their package manager of choice has it. Also the list at repology auto updates and includes the information which versions are packaged.

* Add light colors parsing support

* Update ci.yml

* Update ci.yml

* Make bin only deps set optional

* transparency on start

* release notes

* bump

* bump to 0.10.1

* fix: print version from Cargo.toml with latest clap

Upgrading to clap 3 has changed some behavior in clap, as the
version option is automatically populated. This means the custom
code has never been executed.

Lets fix this by using the clap built in functionality to automatically
use the crate version in the builtin version option.

This fixes commit 7d922a02a0

Signed-off-by: Levente Polyak <levente@leventepolyak.net>

* bump version

* update defer-drop to v1.3.0

* Update Cargo.toml

* bump

* Update README.md

* bump

* doc(discord): discord invitation link

* README.md: "Package Managers": add Portage

* document display issue + fix

* Update sk.1

* Update sk-tmux.1

* remove -K and -R flags from tmux popup: uknown flags (#551)

Co-authored-by: ymnejmi <ymnejmi@github.com>

* chore: fix clippy

* Create dependabot.yml

* Bump log from 0.4.17 to 0.4.22 (#581)

Bumps [log](https://github.com/rust-lang/log) from 0.4.17 to 0.4.22.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.17...0.4.22)

---
updated-dependencies:
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vte from 0.11.0 to 0.13.0 (#582)

Bumps [vte](https://github.com/alacritty/vte) from 0.11.0 to 0.13.0.
- [Release notes](https://github.com/alacritty/vte/releases)
- [Changelog](https://github.com/alacritty/vte/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alacritty/vte/compare/v0.11.0...v0.13.0)

---
updated-dependencies:
- dependency-name: vte
  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>

* Bump derive_builder from 0.11.2 to 0.20.2 (#583)

Bumps [derive_builder](https://github.com/colin-kiegel/rust-derive-builder) from 0.11.2 to 0.20.2.
- [Release notes](https://github.com/colin-kiegel/rust-derive-builder/releases)
- [Commits](https://github.com/colin-kiegel/rust-derive-builder/compare/v0.11.2...v0.20.2)

---
updated-dependencies:
- dependency-name: derive_builder
  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>

* bootstrap contributing.md

* Bump shlex from 1.1.0 to 1.3.0 (#556)

Bumps [shlex](https://github.com/comex/rust-shlex) from 1.1.0 to 1.3.0.
- [Changelog](https://github.com/comex/rust-shlex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/comex/rust-shlex/commits)

---
updated-dependencies:
- dependency-name: shlex
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Cargo: remove unuseful entries (#382)

* feat: use IndexMap to order selected items

* test: add e2e

* update lock after rebase

* prepare merge

* update lock

* clippy

* Delete test.Dockerfile

* fix lockfile

* fix dep version regressions

---------

Signed-off-by: Levente Polyak <levente@leventepolyak.net>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: grant0417 <grant@ggurvis.com>
Co-authored-by: grant0417 <grantgurvis@gmail.com>
Co-authored-by: Merlin <megoettlinger@gmail.com>
Co-authored-by: TD-Sky <three-dim-sky@foxmail.com>
Co-authored-by: Grant G <grant0417@users.noreply.github.com>
Co-authored-by: EdenEast <edenofest@gmail.com>
Co-authored-by: yazgoo <yazgoo@gmail.com>
Co-authored-by: Levente Polyak <levente@leventepolyak.net>
Co-authored-by: onatm <onat.mercan@truelayer.com>
Co-authored-by: yazgoo <yazgoo@users.noreply.github.com>
Co-authored-by: Vitaly Zdanevich <zdanevich.vitaly@ya.ru>
Co-authored-by: sisrfeng <53520949+sisrfeng@users.noreply.github.com>
Co-authored-by: ymnejmi <134085326+ymnejmi@users.noreply.github.com>
Co-authored-by: ymnejmi <ymnejmi@github.com>
Co-authored-by: LoricAndre <loric.andre@pm.me>
Co-authored-by: LoricAndre <57358788+LoricAndre@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
2024-11-18 22:16:23 +01:00
LoricAndre 8a579837da chore: fix clippy 2024-11-07 17:12:16 +01:00
grant0417 7d922a02a0 chore: update deps and fix lots of clippy lints 2022-08-21 01:38:16 -07:00
Liam 7f5381af58 add downcasting example 2021-07-08 12:36:27 -04:00
Jinzhou Zhang d9a0cd6ab0 fix #338: expose key, event in SkimOutput 2020-10-18 09:21:49 +08:00
Jinzhou Zhang 6876ef469d fix #300: move reader related options to default reader 2020-10-05 18:08:04 +08:00
Jinzhou Zhang bc63d346d1 fix #342 expose preview context 2020-10-05 10:54:26 +08:00
Jinzhou Zhang c8d6e02bbc fix #344: implement text() and display() correctly
The finally "display" of an item was drawn by first invoking `display()`
for the content, and then draw the matched indices. When the customized
`display()` did not return the same text as `text()`, the display is
broken.

PR #347 try to fix this by adding a "non-highlight" option. But maybe
it's better to hand over all the drawing tasks to `display()`, including
highlight the matching indices.
2020-10-05 10:54:26 +08:00
Pawel Kubik bcade9c166 Custom keybindings example for the library 2020-09-19 17:13:38 +02:00
Jinzhou Zhang 40099ce0cc [lib] add as_any for SkimItem for downcast
1. add `as_any` for `SkimItem`
2. fix preview: deal with multi-lines prepared text
3. API for preview (non-)colored text

Skim will take trait object `Arc<dyn SkimItem>` and will return it back
in `SkimOutput`. Caller will need the concrete type reference to call
some type-specific methods.  The `AsAny` trait is used for downcasting
`Arc<dyn SkimItem>` back to reference to its concrete type.

Q: Why not use associated type?
1. Associated type would pollute all the type signatures that deals with
   `SkimItem`. Some traits could no longer be made into trait object
   with generic type in their method signature.
   ```
    pub trait MatchEngine: Sync + Send {
        fn match_item<T: SkimItem>(&self, item: Arc<ItemWrapper<T>>) -> Option<MatchedItem<T>>;
    }
   ```
   To fix it would require much more work than I think.
2. Currently the support for "interaction mode" and "append-and-select"
   action is done inside skim. That means some items added to skim could
   not guaentee to be the associated type.
2020-02-07 10:34:29 +08:00
Jinzhou Zhang 322d24e6e2 [ansi] impl from<str|string> for AnsiString 2020-02-06 16:23:29 +08:00
Jinzhou Zhang e3f3d35561 [collector] add helper SkimItemReader 2020-02-05 17:48:54 +08:00
Jinzhou Zhang 83080e305e fix #216 support item specific preview hook method 2020-02-05 15:04:15 +08:00
Jinzhou Zhang 234175be57 [main] able to read from piped stdin 2020-02-05 12:51:30 +08:00
Jinzhou Zhang bbd8f91eac introduce new trait SkimItem 2020-02-04 22:59:36 +08:00
Jinzhou Zhang d6e48e07b4
Merge pull request #168 from ngirard/patch-4
option_builder.rs: remove extraneous line.
2019-05-03 12:30:45 +08:00
ngirard 1885180c7e
option_builder.rs: remove extraneous line. 2019-05-02 23:23:17 +02:00
ngirard 40f35c6c47
sample.rs: remove extraneous line. 2019-05-02 23:20:17 +02:00
Jinzhou Zhang ad32d9a5e9 fix: compilation error of examples 2019-03-19 17:36:26 +08:00
Jinzhou Zhang 74a1319095 [lib] return item instead of matched items 2018-06-03 08:47:15 +08:00
Jinzhou Zhang a6de5970bc [rustfmt] reformat the code 2018-06-02 19:00:58 +08:00
Jinzhou Zhang 0f88e823ce [options] remove SkimOptionsBuilder
Since there are already `Option` options, another wrap on the option
would be too tedious to work with.
2018-06-02 18:48:30 +08:00
Jinzhou Zhang 1bb74b4568 add example for using library
However the library could only be used once cause it did not release the
resources correctly.
2018-06-02 10:57:47 +08:00