| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
violation (#3232)
The script store build() replays all records from the record store into
SQLite but never cleared the database first. Stale rows from previous
builds caused unique constraint violations on the name index when
scripts were renamed or recreated.
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bumps [dashmap](https://github.com/xacrimon/dashmap) from 5.5.3 to
6.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/xacrimon/dashmap/releases">dashmap's
releases</a>.</em></p>
<blockquote>
<h2>v6.1.0</h2>
<ul>
<li><a
href="https://redirect.github.com/xacrimon/dashmap/pull/308">xacrimon/dashmap#308</a></li>
</ul>
<h2>v6.0.1</h2>
<p>This is a patch release, now the main release for v6 as v6.0.0 was
yanked shortly after release.</p>
<p>Thanks to <a
href="https://github.com/JesusGuzmanJr"><code>@JesusGuzmanJr</code></a>
for notifying me about a critical bug that was introduced so that I
could resolve it: <a
href="https://redirect.github.com/xacrimon/dashmap/issues/304">#304</a>.</p>
<p>PRs for this release: <a
href="https://redirect.github.com/xacrimon/dashmap/issues/305">#305</a>
+ <a
href="https://github.com/xacrimon/dashmap/commit/d5c8be6213ca85d7e3ccbcc1eb5b95651ce7e253">https://github.com/xacrimon/dashmap/commit/d5c8be6213ca85d7e3ccbcc1eb5b95651ce7e253</a></p>
<h2>v6.0.0</h2>
<p>This release contains performance optimizations, most notably 10-40%
gains on Apple Silicon but also 5-10% gains when measured in Intel
Sapphire Rapids. This work was accomplished in:</p>
<ul>
<li><a
href="https://redirect.github.com/xacrimon/dashmap/issues/303">#303</a></li>
<li><a
href="https://redirect.github.com/xacrimon/dashmap/issues/287">#287</a></li>
</ul>
<p>Minor QoL improvements were made in:</p>
<ul>
<li><a
href="https://redirect.github.com/xacrimon/dashmap/issues/302">#302</a></li>
<li><a
href="https://redirect.github.com/xacrimon/dashmap/issues/300">#300</a></li>
</ul>
<p>Special to the following contributors for making this release
possible:</p>
<ul>
<li><a
href="https://github.com/conradludgate"><code>@conradludgate</code></a></li>
<li><a
href="https://github.com/arthurprs"><code>@arthurprs</code></a></li>
<li><a
href="https://github.com/joshtriplett"><code>@joshtriplett</code></a></li>
<li><a
href="https://github.com/dtzxporter"><code>@dtzxporter</code></a></li>
</ul>
<h2>v6.0.0-rc.1</h2>
<p>This release contains performance optimizations, most notably 10-40%
gains on Apple Silicon but also 5-10% gains when measured in Intel
Sapphire Rapids. This work was accomplished in:</p>
<ul>
<li><a
href="https://redirect.github.com/xacrimon/dashmap/issues/303">#303</a></li>
<li><a
href="https://redirect.github.com/xacrimon/dashmap/issues/287">#287</a></li>
</ul>
<p>Minor QoL improvements were made in:</p>
<ul>
<li><a
href="https://redirect.github.com/xacrimon/dashmap/issues/302">#302</a></li>
<li><a
href="https://redirect.github.com/xacrimon/dashmap/issues/300">#300</a></li>
</ul>
<p>Special to the following contributors for making this release
possible:</p>
<ul>
<li><a
href="https://github.com/conradludgate"><code>@conradludgate</code></a></li>
<li><a
href="https://github.com/arthurprs"><code>@arthurprs</code></a></li>
<li><a
href="https://github.com/joshtriplett"><code>@joshtriplett</code></a></li>
<li><a
href="https://github.com/dtzxporter"><code>@dtzxporter</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/xacrimon/dashmap/commit/f2d248eb59fe4a06decd8b54a4365ef41400b73c"><code>f2d248e</code></a>
v6.1.0</li>
<li><a
href="https://github.com/xacrimon/dashmap/commit/da6ac5eab31165c57c8487fafd81ade9adb6d158"><code>da6ac5e</code></a>
Add typesize::TypeSize implementation for DashMap/DashSet (<a
href="https://redirect.github.com/xacrimon/dashmap/issues/308">#308</a>)</li>
<li><a
href="https://github.com/xacrimon/dashmap/commit/633aadbd812151a54a60b1845d48c312a2135a14"><code>633aadb</code></a>
v6.0.1</li>
<li><a
href="https://github.com/xacrimon/dashmap/commit/d5c8be6213ca85d7e3ccbcc1eb5b95651ce7e253"><code>d5c8be6</code></a>
add shrink_to_fit test</li>
<li><a
href="https://github.com/xacrimon/dashmap/commit/488dbfa908ada92551560991b0b8a0d17e6679f3"><code>488dbfa</code></a>
fix deadlock in shrink_to_fit (<a
href="https://redirect.github.com/xacrimon/dashmap/issues/305">#305</a>)</li>
<li><a
href="https://github.com/xacrimon/dashmap/commit/458238c114b5d21b26432ac620835166e07eb115"><code>458238c</code></a>
v6.0.0</li>
<li><a
href="https://github.com/xacrimon/dashmap/commit/1e3df1aa8eb1b2c266eac83765136f0d10d8e21d"><code>1e3df1a</code></a>
v6.0.0-rc.1</li>
<li><a
href="https://github.com/xacrimon/dashmap/commit/bdb86b03b4194a209094f146f250c9d9f62baa85"><code>bdb86b0</code></a>
Merge branch 'arthurprs-small-optimizations'</li>
<li><a
href="https://github.com/xacrimon/dashmap/commit/4cdfc396a35713afdb8feb7183b8ea57c100fbbe"><code>4cdfc39</code></a>
fix: merge errors</li>
<li><a
href="https://github.com/xacrimon/dashmap/commit/74b34f836d7aa65a1f11c86465c7a96a80346624"><code>74b34f8</code></a>
Merge branch 'small-optimizations' of github.com:arthurprs/dashmap into
arthu...</li>
<li>Additional commits viewable in <a
href="https://github.com/xacrimon/dashmap/compare/v.5.5.3...v6.1.0">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reduces memory usage of the atuin-daemon search index by ~80% through
string interning, compact UUID storage, and eliminating redundant data.
## Changes
* **Eliminate Vec\<Invocation\>**: Replaced the per-command
`Vec<Invocation>` with just `most_recent_id: [u8; 16]` and
`most_recent_timestamp: i64`. We only ever needed the most recent
history ID for search results - the full invocation history was never
used.
* **UUID byte storage**: Store UUIDs as `[u8; 16]` instead of 36-byte
strings, saving 40 bytes per UUID.
* **String interning with lasso**: Use `ThreadedRodeo` to deduplicate
`cwd` and `hostname` strings in the filter sets. These values are highly
repetitive (most commands run from a small set of directories on the
same host), so interning has an outsized effect.
* **DashSet → HashSet**: Since `CommandData` lives inside a `DashMap`
(already synchronized), the inner sets don't need their own locks.
Switched to `HashSet<Spur>` for directories/hosts and `HashSet<[u8;
16]>` for sessions.
* **Arc\<str\> for commands**: Changed the `commands` DashMap key and
`frecency_map` keys from `String` to `Arc<str>`, enabling zero-copy
sharing between the two maps.
* **Remove dead code**: Removed `CommandData.command` field that was
duplicating the DashMap key.
## Results
With 60k history entries, observed memory usage dropped from ~200MB to
~40MB.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
## Summary
This PR adds a persistent, in-memory search index to the Atuin daemon,
enabling fast fuzzy search without the startup delay of building an
index each time the TUI opens.
### Key Changes
- **Daemon search service**: A new gRPC service that maintains a Nucleo
fuzzy search index in memory
- **Real-time index updates**: The daemon listens for history events
(new commands, synced records) and updates the index immediately
- **Filter mode support**: All existing filter modes work (Global, Host,
Session, Directory, Workspace)
- **New search engine**: `daemon-fuzzy` search mode that queries the
daemon instead of building a local index
- **Paged history loading**: Database pagination support for efficient
initial index loading
- **Configurable logging**: New `[logs]` settings section for daemon and
search log configuration
- **Component-based daemon architecture**: Refactored daemon internals
into a modular, event-driven system
- **Fallback to DB search for regex**: Since Nucleo doesn't support
regex matching
## Daemon Architecture
The daemon has been refactored to use a component-based, event-driven
architecture that makes it easier to add new functionality and reason
about the system.
### Core Concepts
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ Atuin Daemon │
│ │
│ ┌─────────────┐ ┌──────────────────────────────────────────────────┐ │
│ │ Daemon │ │ Components │ │
│ │ Handle │────▶│ │ │
│ │ │ │ ┌─────────────┐ ┌─────────────┐ ┌────────────┐ │ │
│ │ • emit() │ │ │ History │ │ Search │ │ Sync │ │ │
│ │ • subscribe │ │ │ Component │ │ Component │ │ Component │ │ │
│ │ • settings │ │ │ │ │ │ │ │ │ │
│ │ • databases │ │ │ gRPC service│ │ gRPC service│ │ background │ │ │
│ └─────────────┘ │ │ WIP history │ │ Nucleo index│ │ sync │ │ │
│ │ │ └─────────────┘ └─────────────┘ └────────────┘ │ │
│ │ └──────────────────────────────────────────────────┘ │
│ │ ▲ │
│ ▼ │ │
│ ┌─────────────────────────────────────┴────────────────────────────────┐ │
│ │ Event Bus (broadcast) │ │
│ │ │ │
│ │ HistoryStarted │ HistoryEnded │ RecordsAdded │ SyncCompleted │ ... │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
│ ▲ │
│ ┌───────────────────────────────────┴──────────────────────────────────┐ │
│ │ Control Service (gRPC) │ │
│ │ External event injection from CLI commands │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
```
### DaemonHandle
A lightweight, cloneable handle that provides access to shared daemon
resources:
- **Event emission**: `handle.emit(DaemonEvent::...)` broadcasts to all
components
- **Event subscription**: `handle.subscribe()` returns a receiver for
the event bus
- **Settings**: `handle.settings()` for configuration access
- **Databases**: `handle.history_db()` and `handle.store()` for data
access
### Component Trait
Components implement a simple lifecycle:
```rust
#[async_trait]
trait Component: Send + Sync {
fn name(&self) -> &'static str;
async fn start(&mut self, handle: DaemonHandle) -> Result<()>;
async fn handle_event(&mut self, event: &DaemonEvent) -> Result<()>;
async fn stop(&mut self) -> Result<()>;
}
```
### Event-Driven Design
Components communicate via events rather than direct coupling:
| Event | Emitted By | Consumed By |
|-------|-----------|-------------|
| `HistoryStarted` | History gRPC | Search (logging) |
| `HistoryEnded` | History gRPC | Search (index update) |
| `RecordsAdded` | Sync | Search (index update) |
| `HistoryPruned` | CLI (via Control) | Search (index rebuild) |
| `HistoryDeleted` | CLI (via Control) | Search (index rebuild) |
| `ForceSync` | CLI (via Control) | Sync |
| `ShutdownRequested` | Signal handler | All (graceful shutdown) |
### External Event Injection
CLI commands can inject events into a running daemon:
```rust
// After `atuin history prune`
emit_event(DaemonEvent::HistoryPruned).await?;
// After deleting specific items
emit_event(DaemonEvent::HistoryDeleted { ids }).await?;
// Request immediate sync
emit_event(DaemonEvent::ForceSync).await?;
```
This ensures the daemon's search index stays in sync with database
changes made by CLI commands.
## Search Architecture
The search service uses a [forked version of
Nucleo](https://github.com/atuinsh/nucleo-ext) that adds filter and
scorer callbacks, enabling efficient filtering and frecency-based
ranking.
```
┌────────────────────────────────────────────────────────────────┐
│ Atuin Daemon │
│ │
│ ┌─────────────────┐ ┌──────────────────────────────────┐ │
│ │ Event System │───▶│ Search Component │ │
│ │ │ │ │ │
│ │ • RecordsAdded │ │ ┌────────────────────────────┐ │ │
│ │ • HistoryEnded │ │ │ Deduplicated Index │ │ │
│ │ • HistoryPruned │ │ │ │ │ │
│ └─────────────────┘ │ │ CommandData per command: │ │ │
│ │ │ • Global frecency │ │ │
│ ┌─────────────────┐ │ │ • Filter indexes (sets) │ │ │
│ │ Background Task │ │ │ • Invocation history │ │ │
│ │ │ │ └────────────────────────────┘ │ │
│ │ Rebuilds │ │ │ │ │
│ │ frecency map │ │ ▼ │ │
│ │ every 60s │───▶│ ┌────────────────────────────┐ │ │
│ └─────────────────┘ │ │ Nucleo (forked) │ │ │
│ │ │ │ │ │
│ │ │ • Filter callback │ │ │
│ │ │ • Scorer callback │ │ │
│ │ │ • Fuzzy matching │ │ │
│ │ └────────────────────────────┘ │ │
│ └──────────────────────────────────┘ │
│ │ │
│ │ gRPC (Unix socket) │
└──────────────────────────────────────│─────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Search TUI (Client) │
│ │
│ 1. Send query + filter mode + context to daemon │
│ 2. Receive matching history IDs (ranked by frecency) │
│ 3. Hydrate full records from local SQLite database │
│ 4. Display results in TUI │
└─────────────────────────────────────────────────────────────────┘
```
### Nucleo Fork
The [nucleo-ext fork](https://github.com/atuinsh/nucleo-ext) adds two
key features to Nucleo:
1. **Filter callback**: Pre-filter items before fuzzy matching (used for
directory/host/session filtering)
2. **Scorer callback**: Compute custom scores after matching (used for
frecency ranking)
```rust
// Filter: only include commands run in current directory
nucleo.set_filter(Some(Arc::new(|cmd: &String| {
passing_commands.contains(cmd)
})));
// Scorer: combine fuzzy score with frecency
nucleo.set_scorer(Some(Arc::new(|cmd: &String, fuzzy_score: u32| {
let frecency = frecency_map.get(cmd).unwrap_or(0);
fuzzy_score + (frecency * 10)
})));
```
### Deduplicated Index
Commands are stored once per unique command text, with metadata tracking
all invocations:
```rust
struct CommandData {
command: String,
invocations: Vec<Invocation>, // All times this command was run
global_frecency: FrecencyData, // Precomputed frecency score
// O(1) filter indexes
directories: HashSet<String>, // All cwds where command was run
hosts: HashSet<String>, // All hostnames
sessions: HashSet<String>, // All session IDs
}
```
This deduplication means:
- **Fewer items to match**: ~13K unique commands vs ~62K history entries
- **O(1) filter checks**: HashSet lookups instead of scanning
invocations
- **Single frecency score**: Global frecency computed once, used for all
filter modes
### Frecency Scoring
Frecency (frequency + recency) scoring prioritizes recently and
frequently used commands:
```rust
fn compute_frecency(count: u32, last_used: i64, now: i64) -> u32 {
let age_hours = (now - last_used) / 3600;
// Recency: decays over time (half-life ~24 hours)
let recency = (100.0 * (-age_hours as f64 / 24.0).exp()) as u32;
// Frequency: logarithmic scaling
let frequency = (count.ln() * 20.0).min(100.0) as u32;
recency + frequency
}
```
The frecency map is:
- **Precomputed by background task** every 60 seconds
- **Never computed inline** during search (no latency impact)
- **Graceful fallback**: If unavailable, search works without frecency
ranking
### Filter Mode Implementation
| Filter Mode | Implementation |
|-------------|----------------|
| Global | No filter (all commands) |
| Directory | `command.directories.contains(cwd)` |
| Workspace | `command.directories.any(\|d\| d.starts_with(git_root))` |
| Host | `command.hosts.contains(hostname)` |
| Session | `command.sessions.contains(session_id)` |
Filters are pre-computed into a HashSet before the search, making the
filter callback O(1).
### Search Flow
1. **Daemon startup**: Loads history from SQLite in pages, builds
deduplicated index
2. **Frecency precompute**: Background task builds frecency map after
history loads
3. **Search request**: Client sends query with filter mode and context
4. **Filter**: Pre-computed HashSet determines which commands pass the
filter
5. **Match**: Nucleo fuzzy matches the query against command text
6. **Score**: Frecency scorer ranks results (fuzzy score + frecency *
10)
7. **Response**: Returns history IDs for the most recent invocation of
each matching command
8. **Hydration**: Client fetches full records from local SQLite
### Configuration
```toml
# Enable daemon + autostart
[daemon]
enabled = true
autostart = true
# Enable daemon-based fuzzy search
[search]
search_mode = "daemon-fuzzy"
```
## Performance
Performance varies based on several factors, but in most initial testing
with the new architecture shows improvement:
* **Nucleo performs searches up to 4.5x faster**: direct DB search
averages 18.07ms, but the daemon completes the same queries in 3.99ms.
* **IPC overhead is significant, but acceptable**: a significant amount
of wall-time is taken up by the transfer of data over IPC (via UDS in
this case). This averages to about ~7.8ms and accounts for 66% of
client-side wall time.
* **Tail latency improves at every layer**: p99 times correspond to
initial requests, worst-case query patterns, etc. but the average p99
daemon-based response time is 3.6x better than the associated DB-based
search p99 time
* **Query complexity no longer impacts performance**: the Nucleo-based
search shows consistent 2-7ms times regardless of query pattern. The
DB-based search had a 17x variance (3.59ms to 62.46ms).
Interestingly, @ellie - who has a larger history store than I do - gets
even better performance on the IPC layer. This could use a lot more
testing in various edge cases and on various hardware, but seems
promising.
### Regular DB search
```
Individual calls for: db_search
--------------------------------------------------------------------------------------------------------------
# Wall Busy Idle Fields
--------------------------------------------------------------------------------------------------------------
1 32.25ms 32.20ms 47.70µs {"mode":"Fuzzy","query":"^"}
2 19.48ms 19.40ms 84.20µs {"mode":"Fuzzy","query":"^c"}
3 20.40ms 20.10ms 297.00µs {"mode":"Fuzzy","query":"^ca"}
4 13.07ms 13.00ms 69.90µs {"mode":"Fuzzy","query":"^car"}
5 12.17ms 12.10ms 67.10µs {"mode":"Fuzzy","query":"^carg"}
6 20.78ms 20.70ms 76.60µs {"mode":"Fuzzy","query":"^cargo"}
7 9.15ms 9.10ms 53.20µs {"mode":"Fuzzy","query":"^cargo "}
8 10.24ms 10.00ms 237.00µs {"mode":"Fuzzy","query":"^cargo b"}
9 10.01ms 9.68ms 325.00µs {"mode":"Fuzzy","query":"^cargo bu"}
10 5.89ms 5.83ms 57.20µs {"mode":"Fuzzy","query":"^cargo bui"}
11 8.85ms 8.28ms 568.00µs {"mode":"Fuzzy","query":"^cargo buil"}
12 7.70ms 7.49ms 212.00µs {"mode":"Fuzzy","query":"^cargo build"}
13 3.59ms 3.53ms 57.00µs {"mode":"Fuzzy","query":"^cargo build$"}
14 6.50ms 6.44ms 63.60µs {"mode":"Fuzzy","query":"^cargo "}
15 6.48ms 6.38ms 100.00µs {"mode":"Fuzzy","query":"!"}
16 31.68ms 31.60ms 75.90µs {"mode":"Fuzzy","query":"!g"}
17 62.46ms 62.40ms 58.90µs {"mode":"Fuzzy","query":"!gi"}
18 30.35ms 30.30ms 46.90µs {"mode":"Fuzzy","query":"!git"}
19 53.84ms 53.80ms 40.80µs {"mode":"Fuzzy","query":"!git "}
20 19.24ms 19.20ms 39.70µs {"mode":"Fuzzy","query":"!git c"}
21 22.03ms 22.00ms 34.70µs {"mode":"Fuzzy","query":"!git co"}
22 17.13ms 17.00ms 133.00µs {"mode":"Fuzzy","query":"!git com"}
23 16.14ms 15.90ms 242.00µs {"mode":"Fuzzy","query":"!git comm"}
24 5.11ms 5.08ms 28.60µs {"mode":"Fuzzy","query":"!git commi"}
25 7.31ms 7.26ms 52.70µs {"mode":"Fuzzy","query":"!git commit"}
Summary: 25 calls
Wall: avg=18.07ms, min=3.59ms, max=62.46ms, p50=13.07ms, p99=62.46ms
Busy: avg=17.95ms, min=3.53ms, max=62.40ms, p50=13.00ms, p99=62.40ms
```
### Daemon-based search
**Client**
```
Individual calls for: daemon_search
--------------------------------------------------------------------------------------------------------------
# Wall Busy Idle Fields
--------------------------------------------------------------------------------------------------------------
1 13.05ms 2.55ms 10.50ms {"query":"^"}
2 10.65ms 1.40ms 9.25ms {"query":"^c"}
3 10.72ms 1.18ms 9.54ms {"query":"^ca"}
4 5.54ms 485.00µs 5.06ms {"query":"^car"}
5 15.02ms 1.02ms 14.00ms {"query":"^carg"}
6 9.49ms 840.00µs 8.65ms {"query":"^cargo"}
7 5.53ms 555.00µs 4.97ms {"query":"^cargo "}
8 8.56ms 717.00µs 7.84ms {"query":"^cargo b"}
9 12.34ms 1.24ms 11.10ms {"query":"^cargo bu"}
10 8.38ms 650.00µs 7.73ms {"query":"^cargo bui"}
11 13.07ms 770.00µs 12.30ms {"query":"^cargo buil"}
12 17.11ms 709.00µs 16.40ms {"query":"^cargo build"}
13 15.41ms 907.00µs 14.50ms {"query":"^cargo build$"}
14 8.19ms 665.00µs 7.52ms {"query":"^cargo "}
15 7.98ms 1.72ms 6.26ms {"query":"!"}
16 13.56ms 856.00µs 12.70ms {"query":"!g"}
17 8.11ms 624.00µs 7.49ms {"query":"!gi"}
18 14.57ms 775.00µs 13.80ms {"query":"!git"}
19 14.18ms 779.00µs 13.40ms {"query":"!git "}
20 9.62ms 802.00µs 8.82ms {"query":"!git c"}
21 15.50ms 1.50ms 14.00ms {"query":"!git co"}
22 11.58ms 1.48ms 10.10ms {"query":"!git com"}
23 13.82ms 2.12ms 11.70ms {"query":"!git comm"}
24 17.48ms 2.18ms 15.30ms {"query":"!git commi"}
25 14.81ms 1.71ms 13.10ms {"query":"!git commit"}
Summary: 25 calls
Wall: avg=11.77ms, min=5.53ms, max=17.48ms, p50=12.34ms, p99=17.48ms
Busy: avg=1.13ms, min=485.00µs, max=2.55ms, p50=856.00µs, p99=2.55ms
```
**Daemon**
```
Individual calls for: daemon_search_query
--------------------------------------------------------------------------------------------------------------
# Wall Busy Idle Fields
--------------------------------------------------------------------------------------------------------------
1 1.75ms 250ns 1.75ms {"query":"^","query_id":1}
2 4.58ms 125ns 4.58ms {"query":"^c","query_id":2}
3 4.39ms 250ns 4.39ms {"query":"^ca","query_id":3}
4 2.52ms 125ns 2.52ms {"query":"^car","query_id":4}
5 4.44ms 250ns 4.44ms {"query":"^carg","query_id":5}
6 3.66ms 167ns 3.66ms {"query":"^cargo","query_id":6}
7 2.38ms 84ns 2.38ms {"query":"^cargo ","query_id":7}
8 4.13ms 84ns 4.13ms {"query":"^cargo b","query_id":8}
9 4.40ms 167ns 4.40ms {"query":"^cargo bu","query_id":9}
10 3.87ms 125ns 3.87ms {"query":"^cargo bui","query_id":10}
11 4.36ms 84ns 4.36ms {"query":"^cargo buil","query_id":11}
12 3.96ms 333ns 3.96ms {"query":"^cargo build","query_id":12}
13 4.61ms 167ns 4.61ms {"query":"^cargo build$","query_id":13}
14 4.20ms 209ns 4.20ms {"query":"^cargo ","query_id":14}
15 238.17µs 167ns 238.00µs {"query":"!","query_id":15}
16 4.44ms 125ns 4.44ms {"query":"!g","query_id":16}
17 3.47ms 83ns 3.47ms {"query":"!gi","query_id":17}
18 4.57ms 125ns 4.57ms {"query":"!git","query_id":18}
19 7.15ms 167ns 7.15ms {"query":"!git ","query_id":19}
20 4.27ms 250ns 4.27ms {"query":"!git c","query_id":20}
21 5.19ms 292ns 5.19ms {"query":"!git co","query_id":21}
22 4.29ms 417ns 4.29ms {"query":"!git com","query_id":22}
23 4.08ms 125ns 4.08ms {"query":"!git comm","query_id":23}
24 4.50ms 167ns 4.50ms {"query":"!git commi","query_id":24}
25 4.35ms 208ns 4.35ms {"query":"!git commit","query_id":25}
Summary: 25 calls
Wall: avg=3.99ms, min=238.17µs, max=7.15ms, p50=4.29ms, p99=7.15ms
Busy: avg=182ns, min=83ns, max=417ns, p50=167ns, p99=417ns
```
**Nucleo matching time (in daemon)**
```
Individual calls for: nucleo_match
--------------------------------------------------------------------------------------------------------------
# Wall Busy Idle Fields
--------------------------------------------------------------------------------------------------------------
1 1.73ms 125ns 1.73ms {"query":"^","query_id":1}
2 4.57ms 167ns 4.57ms {"query":"^c","query_id":2}
3 4.37ms 125ns 4.37ms {"query":"^ca","query_id":3}
4 2.51ms 84ns 2.51ms {"query":"^car","query_id":4}
5 4.43ms 125ns 4.43ms {"query":"^carg","query_id":5}
6 3.64ms 125ns 3.64ms {"query":"^cargo","query_id":6}
7 2.37ms 84ns 2.37ms {"query":"^cargo ","query_id":7}
8 4.11ms 125ns 4.11ms {"query":"^cargo b","query_id":8}
9 4.36ms 208ns 4.36ms {"query":"^cargo bu","query_id":9}
10 3.85ms 125ns 3.85ms {"query":"^cargo bui","query_id":10}
11 4.35ms 125ns 4.35ms {"query":"^cargo buil","query_id":11}
12 3.94ms 250ns 3.94ms {"query":"^cargo build","query_id":12}
13 4.59ms 125ns 4.59ms {"query":"^cargo build$","query_id":13}
14 4.18ms 84ns 4.18ms {"query":"^cargo ","query_id":14}
15 220.13µs 125ns 220.00µs {"query":"!","query_id":15}
16 4.43ms 125ns 4.43ms {"query":"!g","query_id":16}
17 3.45ms 125ns 3.45ms {"query":"!gi","query_id":17}
18 4.55ms 125ns 4.55ms {"query":"!git","query_id":18}
19 7.12ms 209ns 7.12ms {"query":"!git ","query_id":19}
20 4.25ms 166ns 4.25ms {"query":"!git c","query_id":20}
21 5.18ms 125ns 5.18ms {"query":"!git co","query_id":21}
22 4.27ms 125ns 4.27ms {"query":"!git com","query_id":22}
23 4.06ms 292ns 4.06ms {"query":"!git comm","query_id":23}
24 4.46ms 166ns 4.46ms {"query":"!git commi","query_id":24}
25 4.31ms 208ns 4.31ms {"query":"!git commit","query_id":25}
Summary: 25 calls
Wall: avg=3.97ms, min=220.13µs, max=7.12ms, p50=4.27ms, p99=7.12ms
Busy: avg=147ns, min=84ns, max=292ns, p50=125ns, p99=292ns
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
Adds `author` and `intent` to client history records and DB persistence,
including migration/backfill and CLI/daemon propagation.
Introduces V2 record-store history version `v1` while retaining read
compatibility for legacy `v0` records.
Adds `--author` and `--intent` flags to `atuin history start`, plus
`{author}` and `{intent}` format keys for listing/history output.
Updates shell-integration docs for `ATUIN_HISTORY_AUTHOR` and
`ATUIN_HISTORY_INTENT`, and updates related tests/fixtures.
Validated with `cargo test -p atuin-client --lib`, `cargo test -p
atuin-daemon --tests`, `cargo test -p atuin search::inspector`, and
`cargo fmt --check`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR refines the system created in #3178 to be suitable for a v1
release.
---
## Overview
`atuin-ai` is a separate binary that allows for generating commands and
asking questions from the command line.
It is fully opt-in.
## Usage
`atuin ai init` will output bindings for your shell. Currently, bash,
zsh, and fish are supported.
```bash
eval "$(atuin ai init)"
```
Once the hooks are installed, just press `?` on an empty prompt line to
call up the TUI.
`atuin ai` requires an account on [Atuin Hub](https://hub.atuin.sh/);
you will be prompted to log in on first use.
## Features
### Command generation
Prompt the LLM to create a command, and get one back, no fuss. Press
`enter` to run, or `tab` to insert.
```
┌Ask questions or generate a command:──────────────────────────┐
│ │
│ > Get a list of running docker containers │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ $ docker ps │
│ │
└────[Enter]: Run [Tab]: Insert [f]: Follow-up [Esc]: Cancel┘
```
### Follow-up
You can follow-up with `f` to specify a refinement prompt to update the
command that will be inserted.
```
┌Ask questions or generate a command:──────────────────────────┐
│ │
│ > Get a list of running docker containers │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ $ docker ps │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ > Actually I want to get all docker containers │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ $ docker ps -a │
│ │
└────[Enter]: Run [Tab]: Insert [f]: Follow-up [Esc]: Cancel┘
```
You can also follow-up with questions to get responses in natural
language.
```
┌Ask questions or generate a command:──────────────────────────┐
│ │
│ > Get a list of running docker containers │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ $ docker ps │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ > Actually I want to get all docker containers │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ $ docker ps -a │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ > What other useful flags to `docker ps` should I know? │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ Here are some handy `docker ps` flags: │
│ │
│ - `-q` — Only show container IDs (great for piping to │
│ other commands) │
│ - `-s` — Show container sizes │
│ - `-n 5` — Show the last 5 created containers │
│ - `-l` — Show only the latest created container │
│ - `--no-trunc` — Don't truncate output (shows full IDs and │
│ commands) │
│ - `-f` or `--filter` — Filter by condition, e.g.: │
│ - `-f status=exited` — only exited containers │
│ - `-f name=myapp` — filter by name │
│ - `-f ancestor=nginx` — filter by image │
│ - `--format` — Custom output using Go templates, e.g.: │
│ `--format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"` │
│ │
│ A common combo is `docker ps -aq` to get all container │
│ IDs, useful for bulk operations like `docker rm $(docker │
│ ps -aq)`. │
│ │
└────[Enter]: Run [Tab]: Insert [f]: Follow-up [Esc]: Cancel┘
```
You can use `enter` or `tab` at any time to run or insert the last
suggested command, even if it was suggested in a previous turn.
### Conversational and search usage
If you prompt the LLM with a question that doesn't imply you want to
generate a command, it can respond in natural language, and use web
search if necessary to fetch the data it needs.
```
┌Ask questions or generate a command:──────────────────────────┐
│ │
│ > What is the latest version of atuin? │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ ✓ Used 2 tools │
│ │
│ The latest version of Atuin is **v18.12.0**, available on │
│ the [GitHub releases │
│ page](https://github.com/atuinsh/atuin/releases). │
│ │
└─────────────────────────────────[f]: Follow-up [Esc]: Cancel┘
```
### Dangerous or low-confidence command detection
The LLM scores its confidence in the command, as well as how dangerous
the command is. This information is shown if a threshold is exceeded,
and requires an extra confirmation step before running automatically
with `enter`.
The Atuin Hub server also monitors suggested commands for dangerous
patterns the LLM didn't catch, and appends its own assessment at the end
of the LLM's own assessment.
```
┌Ask questions or generate a command:──────────────────────────┐
│ │
│ > Delete all files from $HOME │
│ │
├──────────────────────────────────────────────────────────────┤
│ │
│ $ rm -rf $HOME/* │
│ │
│ ! ⚠️ This will PERMANENTLY delete ALL files and directories │
│ in your home directory, including documents, downloads, │
│ configurations, SSH keys, and everything else. This is │
│ irreversible and will likely break your system. Also note │
│ this won't delete hidden (dot) files — if you want those │
│ too, that's even more destructive.; [Server] Recursive │
│ delete of critical directory │
│ │
└────[Enter]: Run [Tab]: Insert [f]: Follow-up [Esc]: Cancel┘
```
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The functionality to run a tmux popup has the problem that the command
runs as a child of the `tmux` *server* process, rather than the current
shell. One potential issue is that the `$PATH` is not forwarded to this
command, so the `atuin` command may not be found.
Fixes: https://github.com/atuinsh/atuin/issues/3182 (#3182)
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
Bumping the prost related crates and avoiding as much compat packages as
possible. There's still the axum0.7 compat which is introduced with this
change, but the update to get rid of that seems more involved
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing (https://github.com/atuinsh/atuin/pull/2896)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
Silent DB failures breaking shell when disk is full
When storage runs out (i.e. disk full), atuin breaks the shell by
continuously printing database errors for every character typed. This is
a fix to silence the DB errors
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Resolves #3169
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR lets you change the current search context to the one of the
currently selected command, which lets you easily see the surrounding
commands of its session.
It adds the following:
- `switch-context` and `clear-context` actions
- A `has-context` condition
- `CTX:` and `C>` prefixes to show we're in another context
The `switch-context` behavior is as follows:
- The selected command defines the new context
- The filter mode is automatically switched to SESSION
- The search input is cleared, which gives you a full overview of the
other commands executed in the same session
- The command which triggered this mode keeps being selected to get a
clear overview
- The filter mode can be changed to modes such as DIRECTORY, but not to
GLOBAL or SESSION+ as IMO those would be confusing in this mode
This lets you easily navigate between modes and commands the way you
prefer, for instance by switching the context through selected commands
or switching back to the default mode with the same key.
This could certainly still be improved (the docs are missing for
instance), and if you have any feedback I can change the behavior as you
see fit. I can add the docs when you'll approve the new names.
Closes #2784
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
---------
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR adds a keybind condition called `original-input-empty` that is
true when the TUI was invoked from an empty prompt line; users can use
this to change behavior based on the original prompt's contents; for
example:
```toml
[keymap.emacs]
"esc" = [
{ when = "original-input-empty", action = "return-query" },
{ action = "return-original" }
]
```
Thanks Hazilo in Discord for the suggestion.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR fixes:
+ #3154
+ #3164
+ #3166
It changes the following:
+ Pass ATUIN_SESSION to tmux popup
+ Use `command rm` to bypass user-defined configs
+ Disable tmux popup by default
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
---------
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
improvements (#3161)
Addresses the keybinding audit (#3157):
- Add missing vim-normal bindings: 0, $, w, b, e, x, dd, D, C
- Add new CursorWordEnd action for vim 'e' motion
- Add VimChangeToEnd action for vim 'C' motion
- Add Media key support (play, pause, stop, volume, etc.)
- Refactor inspector keymap to be minimal but respect enter_accept
and provide vim-style j/k navigation for vim users
- Add $ to special character parsing
- Replace eprintln! with tracing::warn! for config errors
- Document shifted punctuation keys and media keys
To be rebased once #3158 is merged
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixes #3156
Fixes #3085
* `Enter` was not bound in the default vim-normal mode keybinds
* `Shift-tab` can be reported as `BackTab`; we convert this at detection
time to `shift-tab`
* `Insert` key was not handled
Verified fixes locally.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
I don't know why the previous PR
https://github.com/atuinsh/atuin/pull/2643 got auto-closed after a
rebase, so I am re-creating it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This shows stderr output from `atuin search -i` in PowerShell:
The output looks like this:
<img width="628" height="149" alt="image"
src="https://github.com/user-attachments/assets/c0a4bc9a-5d57-415f-a5b4-9c497744c6e0"
/>
Currently reproducible with the following config:
```toml
[keymap.emacs]
"foo" = "bar"
"=" = "bar"
```
I started by using `Start-Process` in the first commit, but then rewrote
it entirely as using a `Process` object directly should be more stable
(`Start-Process` already [caused
issues](https://github.com/atuinsh/atuin/pull/2543#issuecomment-2647555114)
in the past).
This fixes the PowerShell part of #3134
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
## Summary
SQLite doesn't support an `IF NOT EXISTS` on `ALTER TABLE`
> https://www.sqlite.org/lang_altertable.html
```
atuin | Caused by:
atuin | Other(while executing migration 20260127000000: error returned from database: (code: 1) near "exists": syntax error
atuin |
atuin | Caused by:
atuin | 0: error returned from database: (code: 1) near "exists": syntax error
atuin | 1: (code: 1) near "exists": syntax error
```
The fix works on my setup
Ref:
https://github.com/atuinsh/atuin/pull/3108#pullrequestreview-3713606584
Signed-off-by: Sped0n <hi@sped0n.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
resolves #3142
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
e.g. bash has these mapped to Ctrl-u/k.
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
(#3138)
Fixes two keymap issues introduced in #3127:
1. Space key does nothing - Pressing space in the search input didn't
insert a space character
2. F12 not recognized - Function keys (F1-F24) couldn't be used in
`[keymap]` config
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
Resolves #3134
Otherwise, I would like to figure out a nicer way for both logging, and
for surfacing user-facing errors from the tui. perhaps similar to our
current method of shell communication (`__atuin_accept`, etc), just
providing an error for the shell integration to log
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
groundwork for #2155. These functions can be reused when building the
interactive TUI.
Adds `--sort-by`, `--reverse`, `--name`, and `--value` flags to `atuin
dotfiles alias list` and `atuin dotfiles var list`. Also adds
`--exports-only` and `--shell-only` for vars.
happy to expand (or reduce?) on this if needed.
<details>
<summary>**Demo/Examples:**</summary>
`$atuin dotfiles alias list --reverse`
```bash
vim=nvim
py=python3
ll=ls -la
k=kubectl
gs=git status
gp=git push
gd=git diff
gc=git commit
dc=docker-compose
d=docker
```
`$atuin dotfiles alias list --sort-by value`
```bash
d=docker
dc=docker-compose
gc=git commit
gd=git diff
gp=git push
gs=git status
k=kubectl
ll=ls -la
vim=nvim
py=python3
```
`$atuin dotfiles alias list -n g`
```bash
gc=git commit
gd=git diff
gp=git push
gs=git status
```
`$atuin dotfiles var list --exports-only`
```bash
export EDITOR=vim
export LANG=en_US.UTF-8
export PAGER=less
export RUST_BACKTRACE=1
```
</details>
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These files have been known to have corruption issues. SQLite will
perform better across filesystems for reads/writes across threads, and
will lock as expected.
I've also put the session file in there, though I'm 50/50 on it - I'll
be replacing it with keyring storage asap anyway.
The key file is _not_ included. It should ~never be changed, and should
be easy for the user to secure + manage themselves
In the future, instead of creating more files, we can just use this as a
kv store
Resolves https://github.com/atuinsh/atuin/issues/2336, resolves
https://github.com/atuinsh/atuin/issues/1650
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a parameter to change the upload/download page size, this
could help if one gets a '413' in a selfhosted scenario.
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
---------
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
|
| |
|
|
|
|
|
|
|
| |
Resolves #3028
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, home_dir() read $HOME directly and panicked if it wasn't
set. This could happen in environments like `nix develop -i` which strip
the environment.
The directories crate (already a dependency) falls back to getpwuid_r
when $HOME is not set, resolving the home directory from /etc/passwd.
Fixes #3123
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We had an issue where the server was returning an empty page, when it
should not, and causing the client to keep looping
While such bugs should not happen, putting the client into a loop does
not help
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is related to:
- #3090
- #1906
---
## No longer relevant:
~I often just hold the backspace key to clear the query line in Atuin,
and the change in #3090 makes it no longer possible: it accepts the
current history entry instead.~ 🤯
~It may be a muscle memory thing, but it also feels wrong to me for the
left key to accept the current entry. I'd prefer for it to do nothing
when the cursor is at the start of the line (I've set
`exit_past_line_start = false` in my config).~
~This PR makes the new behavior configurable: it adds an
`accept_past_empty_line` setting (naming is *hard*, feel free to find a
better name) which lets you disable it. It also updates the `[keys]`
docs.~
BTW wouldn't setting the `accept_past_line_start` and
`accept_with_backspace` settings to `true` (maybe by default) have the
same effect as what #3090 introduced?
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default width of the `exit` column is 3, which matches the 0-255
values on Linux. However, on Windows it is a 32-bit integer, and can be
anything from -2147483648 to 2147483647. Popular tools such as `winget`
apparently make use of that.
Here's an example with `columns = ["exit", "time", "duration",
"directory", "command"]`:
<img width="647" height="416" alt="image"
src="https://github.com/user-attachments/assets/d73b0487-3c77-4049-8487-01b2aab29a44"
/>
This PR changes the default column width to 11 on Windows to match these
values. The result is:
<img width="601" height="412" alt="image"
src="https://github.com/user-attachments/assets/b4b95f40-f223-400d-83c4-74d71e070b3e"
/>
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`$LASTEXITCODE` is an [automatic
variable](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-7.5#lastexitcode)
in PowerShell which holds the exit code of the last *native* program
which has run. It's a close equivalent to `$?` in bash (PowerShell also
has [its own `$?`
variable](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-7.5#section-1),
but it's a boolean).
Atuin is a native program, and the `PSConsoleHostReadLine` function
calls `atuin history start`, which resets this variable to 0 (or to
something else if it fails).
This PR resets this variable to its previous value, as it is that one
which the user will expect.
Before:
<img width="453" height="225" alt="image"
src="https://github.com/user-attachments/assets/5fc781d3-dbba-4737-b2ec-7ba73739d006"
/>
After:
<img width="460" height="212" alt="image"
src="https://github.com/user-attachments/assets/a2db9bca-343c-48fc-ab45-167e0dd6f7f9"
/>
Default behavior (without a profile file or Atuin):
<img width="351" height="147" alt="image"
src="https://github.com/user-attachments/assets/47d6aa28-1ea9-4e55-9879-98359ad3fbcf"
/>
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
In the [2.0.0](https://github.com/ardaku/whoami/releases/tag/v2.0.0)
series, `whoami` removed all infallible function variants, and removed
the `fallible` module, moving those functions to the root module.
Therefore, I replaced `whoami::fallible::hostname` with
`whoami::hostname` (the same function with the same signature, just
moved to the root module).
For `whoami::username`, the infallible function that `atuin` was using
before is gone, and we must add error handling. I chose to fall back to
the string `"unknown-user"` if getting the username fails, just as
`"unknown-host"` is already the fallback when getting the hostname
fails. This seemed reasonable to me, but it’s worth double-checking if
there could be any unintended consequences, especially if `unknown-user`
happens to be a real, valid username on the system. The alternatives I
can see would be to panic on failure or to amend the signature of
`get_username()` and all of its call sites with some kind of more
graceful error handling (what?).
## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
| |
Reverts atuinsh/atuin#3090
Can be achieved by setting
```
accept_past_line_start = true
accept_with_backspace = true
```
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A combined binary was an early dev decision, when I thought most users
would be self hosting. It is now clear that in actual fact, most users
do not self host. So let's avoid forcing every user to have a copy of
the server literally linked in, and let's stop building server deps over
and over.
The deployment for this shouldn't change. `dist` will build a binary for
this automatically, and will also add it to the installer. The latter is
perhaps something we should explore changing too!
<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [ ] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
|