Commit graph

219 commits

Author SHA1 Message Date
dependabot[bot]
3faadd709f
build(deps): bump libc from 0.2.182 to 0.2.183
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.182 to 0.2.183.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.183/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.182...0.2.183)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-09 16:36:04 +00:00
raf
8754921106
Merge pull request #70 from NotAShelf/dependabot/cargo/ctrlc-3.5.2
build(deps): bump ctrlc from 3.5.1 to 3.5.2
2026-03-06 16:55:56 +03:00
raf
be6cde092a
Merge pull request #71 from NotAShelf/notashelf/push-nnnqqrzkpywp
stash/db: general cleanup; async db ops for `watch` & deterministic hashing
2026-03-06 16:55:43 +03:00
b1f43bdf7f
db: replace \CHECKED\ atomic flag with pattern-keyed regex cache
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9d5fa5212c5418ce6bca02d05149e1356a6a6964
2026-03-05 16:07:49 +03:00
373affabee
db: improve content hashing; cache only positive scan result
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If8035bf1dcd598a992762b9c714253406a6a6964
2026-03-05 15:07:32 +03:00
0865a1f139
commands/list: debounce for rapid copy operations
Tracks the entry ID currently being copied in `TuiState` to prevent
concurrent `copy_entry()` calls on the same entity. Otherwise we hit a
race condition. Fun!


Track the entry ID currently being copied in TuiState to prevent
concurrent copy_entry() calls on the same entry. Fixes database
race conditions when users trigger copy commands in rapid succession.



Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If8e8fe56bf6dc35960e47decf59636116a6a6964
2026-03-05 15:07:31 +03:00
cf5b1e8205
db: tests for determinism & async ops
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2591e607a945c0aaa28a75247fc638436a6a6964
2026-03-05 15:07:30 +03:00
95bf1766ce
stash: async db operations; make hashes deterministic
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iccc9980fa13a752e0e6c9fb630c28ba96a6a6964
2026-03-05 15:07:24 +03:00
7184c8b682
db: consolidate duplicated SQL queries
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8b6889d1e420865d0a8d3b8da916d8086a6a6964
2026-03-05 12:56:56 +03:00
ffdc13e8f5
commands/list: allow printing in reversed order with --reverse
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I305cfdc68d877dc5d5083a76dccc62db6a6a6964
2026-03-05 09:34:37 +03:00
dependabot[bot]
5e0599dc71
build(deps): bump ctrlc from 3.5.1 to 3.5.2
Bumps [ctrlc](https://github.com/Detegr/rust-ctrlc) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/Detegr/rust-ctrlc/releases)
- [Commits](https://github.com/Detegr/rust-ctrlc/compare/3.5.1...3.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 16:28:36 +00:00
181edcefb1
db: add MIME sniffing for binary clipboard previews
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I70416269dd40496758b6e5431e77a9456a6a6964
2026-02-27 12:15:10 +03:00
ebf46de99d
docs: add installation instructions for crates.io
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib9a3fc7ee21324707d046d52a24b50596a6a6964
2026-02-27 10:34:38 +03:00
ba2e29d5b7
docs: fix HTML formatting; mention Cliphist's features
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I92716daef01c00bbe8e75426c3662fbb6a6a6964
2026-02-27 10:09:04 +03:00
3a14860ae1
various: validate lower and upper boundaries before storing; add CLI flags
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6484f9579a8799d952b15adcb47c8eec6a6a6964
2026-02-27 07:59:28 +03:00
02ba05dc95
db: add new error variants for entries below minimum and above maximum sizes
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icba2920cfef0ffb0ce6435ab6d7809166a6a6964
2026-02-27 07:58:46 +03:00
469fccbef6
chore: release v0.3.6 v0.3.6
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2adaf9944a4572dcd15157f32b52eec26a6a6964
2026-02-26 16:24:42 +03:00
117e9d11ef
docs: add cliphist to attributions section; add motivation section
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia3da5b4dc3aeeb98eafc77173ae592596a6a6964
2026-02-26 16:24:40 +03:00
raf
23bf9d4044
Merge pull request #68 from NotAShelf/notashelf/push-vqzzqprquvxk
commands/list: full TUI rewrite for better perf
2026-02-26 16:15:40 +03:00
b850a54f7b
commands/list: implement clipboard history search
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I57f00cbd9d02b1981cf3ea5dc908e72c6a6a6964
2026-02-26 12:06:18 +03:00
88c1f0f158
commands/list: full TUI rewrite for better perf
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I49009a89542fdeeea31d3755108b53d06a6a6964
2026-02-26 12:06:17 +03:00
0215ebeb6c
chore: recursively bump time dep
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I57471a3c88a4cfe2d267f0fa8ceb59946a6a6964
2026-02-26 11:09:51 +03:00
raf
ce98b6db09
Merge pull request #67 from NotAShelf/notashelf/push-otlvvpomrtom
meta: bump deps & MSRV; allow disabling multicall bins
2026-02-26 09:38:49 +03:00
4d58cae50d
nix: add platforms to meta; allow overriding symlink behaviour
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib6e44abd86bd0e58f290b456680a97236a6a6964
2026-02-26 09:12:27 +03:00
2e3c73957a
meta: allow disabling symlinks in build script via env vars
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I07f5d565d26ca527d413edf69857539e6a6a6964
2026-02-26 09:12:26 +03:00
d367728b39
chore: set MSRV to 1.91.0
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iadde6dfe7e79a365edf4d664b941c0776a6a6964
2026-02-26 09:12:25 +03:00
2edecf4c17
chore: format with taplo
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I942883a08eccc5decd38a6865b3451496a6a6964
2026-02-26 09:12:24 +03:00
134da06fd0
chore: bump dependencies
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I53a5279d1c3e74ae54e2f32a800f83766a6a6964
2026-02-26 09:12:06 +03:00
2227ef7e89
chore: format Cargo manifest with Taplo; v0.3.5 v0.3.5
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id35b12bba16b0e181bb4536154259b5a6a6a6964
2026-02-01 18:12:53 +03:00
2e086800d0
chore: format TOML with Taplo
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2ecc8923946ace5288a1c45ca202cb956a6a6964
2026-02-01 18:12:52 +03:00
cff9f7bbba
chore: bump dependencies
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib0445df9b8e5f0d4aabfcd4ff1bc27f16a6a6964
2026-02-01 18:12:51 +03:00
raf
23bb89e3ea
Merge pull request #61 from NotAShelf/notashelf/push-wompwwqskzwu
mime: refactor mime detection to separate module; streamline
2026-02-01 16:45:41 +03:00
9afbe9ceca
watch: deprioritize text/html in MIME negotiation
Firefox and Electron apps offer `text/html` first when copying images,
which causes stash to store the HTML wrapper (`<img src="...">`) instead
of the actual image data, which is what we want. We handicap, i.e.,
deprioritize `text/html` in the "any" preference mode and prefer
`image/*` types first, then any non-html type. 

This sounds a little illogical, but in user will almost always prefer
the image itself rather than the text representation. So it's intuitive.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6bd5969344893e15226c27071442475f6a6a6964
2026-02-01 14:55:31 +03:00
3fd48896c1
watch: respect source MIME type order in clipboard polling
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I3da2e187276611579f3686acb20aacf36a6a6964
2026-02-01 11:55:18 +03:00
b4dd704961
db: add an in-memory test helper
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I22cc10df47265fa4d08d5c03cadbe9c56a6a6964
2026-02-01 11:55:17 +03:00
bb8e882565
mime: expand test coverage
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I3f17b98ad68f17ebcf9554e5e88f62676a6a6964
2026-02-01 11:55:02 +03:00
5c8591b2e5
docs: mention MIME preference usage in README
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I3bda3397f0350f27523b419bd079f8756a6a6964
2026-01-23 23:13:02 +03:00
ff2f272055
mime: refactor mime detection to separate module; streamline
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I489054d2537a4c0de32d79f793478c206a6a6964
2026-01-23 23:13:01 +03:00
raf
ded38723d4
Merge pull request #60 from NotAShelf/notashelf/push-wvyzsrrzyrum
add auto-expiry mechanism to `stash watch`
2026-01-23 21:10:41 +03:00
e185ecd32a
docs: document entry expiry features for stash watch & db cmds
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I60fe5afdb6e903b96023ca420bb7902d6a6a6964
2026-01-22 19:40:41 +03:00
b00e9b5f3a
watch: clear clipboard when expired entry content matches current clipboard
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4bede5db16cea993ed8e8591e8d198d56a6a6964
2026-01-22 18:27:24 +03:00
5731fb08a5
cli: add db subcommand
Adds a `db` subcommand with `DbAction` for three new database
operations: wipe, vacuum and stats. We can extend this database later,
but this is a very good start for now and plays nicely with the
`--expired` flag. This soft-deprecates `stash wipe` in favor of a `stash
db wipe` with the addition of a new `--expired` flag that wipes the
expired entries only. 

The `list` subcommand has also been refactored to allow for a similar
`--expired` flag that lists only expired entries.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I34107880185d231d207b0dab7782d5d96a6a6964
2026-01-22 16:56:44 +03:00
2e555ee043
commands/list: add include_expired parameter for filtering
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia1ab13345cfa5e2cf9a92f8b32a6a9826a6a6964
2026-01-22 16:56:43 +03:00
b070d4d93d
watch: implement soft-delete behaviour for expired entries
The previous `--expire-after` flag behave more like *delete* after
rather than *expire*. This fixes that, and changes the behaviour to
excluding expired entries from list commands and already-marked expired
entries from expiration queue. Updates log messages accordingly.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib162dff3a76e23edcdfbd1af13b01b916a6a6964
2026-01-22 16:56:42 +03:00
d40b547c07
db: add is_expired column and implement vacuum/stats commands
Migrates schema to v5; `is_expired` column is added with partial index
and `include_expired` parameter to `list_entries()` and `list_json()`
methods. Also adds `vacuum()` and `stats()` methods for SQlite
"administration", and removes `next_sequence()` from trait and impl.

This has been a valuable addition to stash, as the database is now *less
abstract* in the sense that user is made aware of its presence (stash
wipe -> stash db wipe) and can modify it.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icfab67753d7f18e3798c0a930b16d05e6a6a6964
2026-01-22 16:56:41 +03:00
f4936e56ff
cli: add --expire-after flag to watch and --expired flag to list
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I833e7bfaecb5e3254d2ea16f2b880e246a6a6964
2026-01-22 16:56:40 +03:00
dd7a55c760
watch: implement expiration queue w/ sub-second precision
This adds a Neg wrapper struct for min-heap behaviour on BinaryHeap
which has proven *really* valuable. Also modify `watch()` to take the
`expire_after` argument for various new features. See my previous commit
for what is actually new.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8705d404eae5d93ad48f738a24f698196a6a6964
2026-01-22 16:56:39 +03:00
71fc1ff40f
db: add `expires_at column and expiration management methods
Schema v4: add expires_at REAL column with partial index for NULL values

Other relevant methods that were added:

- `now()` for Unix timestamp with sub-second precision
- `cleanup_expired()` to remove all expired entries
- `get_expired_entries()` for for diagnostic output (`stash list --expired`)
- `get_next_expiration()` for heap initialization
- `set_expiration()` to update expiration timestamp

This feature has proven larger than I had anticipated (and hoped) but
that's the reality of dealing with databases. Some of the methods are
slightly redundant but it helps keep tracing the code manageable and
semantically correct. We'll probably not regret those later. Probably.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie9e5b0767673e74389b8e59c466afd946a6a6964
2026-01-22 16:56:38 +03:00
bb1c5dc50b
chore: release v0.3.4 v0.3.4
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie637c425e0d13985e3025a2ebaac41916a6a6964
2026-01-22 14:04:20 +03:00
441334a250
chore: bump dependencies
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8ef1f283622f50d93ba9d581699e272b6a6a6964
2026-01-22 14:04:19 +03:00