Commit Graph

271 Commits

Author SHA1 Message Date
Ellie Huxtable
2fba4aae93
feat: allow ignoring failed commands (#1957)
* feat: allow ignoring failed commands

* cleanup
2024-04-18 08:18:15 +01:00
Ellie Huxtable
cb19925011
feat(gui): work on home page, sort state (#1956)
1. Start on a home page, can sort onboarding/etc from there
2. Introduce zustand for state management. It's nice!

Did a production build and clicked around for a while. Memory usage
seems nice and chill.
2024-04-17 14:06:05 +01:00
Ellie Huxtable
a0231a7095
chore(release): prepare for release v18.2.0 (#1950)
* chore(release): prepare for release v18.2.0

* disable codespell for the changelog
2024-04-15 10:37:28 +01:00
Conrad Ludgate
c41998e98a
fix: use spawn_blocking for file access during async context (#1936) 2024-04-12 10:40:14 +01:00
Ellie Huxtable
6cd4319fcf
feat(gui): add base structure (#1935)
* initial

* ui things

* cargo

* update, add history refresh button

* history page a bit better, add initial dotfiles page

* re-org layout

* bye squigglies

* add dotfiles ui, show aliases

* add default shell detection

* put stats in a little drawer, alias import changes

* use new table for aliases, add alias deleting

* support adding aliases

* close drawer when added, no alias autocomplete

* clippy, format

* attempt to ensure gdk is installed ok

* sudo

* no linux things on mac ffs

* I forgot we build for windows too... end of day

* remove tauri backend from workspace
2024-04-11 16:59:01 +01:00
dependabot[bot]
28084a0963
chore(deps): bump regex from 1.10.3 to 1.10.4 (#1930)
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.3 to 1.10.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.3...1.10.4)

---
updated-dependencies:
- dependency-name: regex
  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>
2024-04-08 13:02:08 +01:00
Yaroslav Halchenko
28b0b490f9
chore(ci): Add codespell support (config, workflow) and make it fix some typos (#1916)
* Add github action to codespell main on push and PRs

* Add rudimentary codespell config

* ignore crate, inbetween etc

* [DATALAD RUNCMD] run codespell throughout fixing typo automagically but ignoring the failure due to ambigous typos

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w || :",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

* [DATALAD RUNCMD] Do interactive fixing of  leftover ambigous typos

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w -i 3 -C 2",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
2024-04-05 15:51:57 +01:00
Ellie Huxtable
bb0ea6c516
fix: report non-decodable errors correctly (#1915) 2024-04-02 16:52:45 +01:00
Ellie Huxtable
e7f808d50a
feat: sync v2 default for new installs (#1914) 2024-04-02 14:41:13 +01:00
Ellie Huxtable
48b4e34776
feat(search): add better search scoring (#1885)
* feat(search): add better search scoring

* add opt-in
2024-04-02 12:13:00 +01:00
Ellie Huxtable
82a7c8d321
fix(search): case insensitive hostname filtering (#1883) 2024-03-15 08:50:43 +00:00
Ellie Huxtable
74182aad42
chore(release): prepare for release v18.1.0 (#1854) 2024-03-11 14:33:03 +00:00
Ellie Huxtable
da24f734e5
feat: add automatic history store init (#1831) 2024-03-06 11:55:53 +00:00
Ellie Huxtable
14be7e048e
feat(dotfiles): add enable setting to dotfiles, disable by default (#1829) 2024-03-05 14:50:42 +00:00
Rain
95e9530dad
fix(build): make atuin compile on non-win/mac/linux platforms (#1825)
Hi!

I've been trying to get atuin set up on the illumos machine I built for work
@oxidecomputer, and I ran into a few issues which are fixed here:

1. The `clipboard` feature was only supported on Windows, Mac and Linux. I've
   added a platform gate for that.
2. The `atomic-write-file` crate needed an update to the version of `nix` --
   that is included.
3. As part of this, I found a [security
   bug](https://rustsec.org/advisories/RUSTSEC-2024-0020.html) in the whoami
   crate. The bug has been fixed upstream and I've included it.

   whoami 1.5.0 deprecates the `hostname` function, which produced some fresh
   warnings. While fixing the warnings I also took the liberty of doing some
   code rearrangement, adding a few functions that wrap some common operations. I
   didn't really know where to put those functions, so I created a new `utils`
   module for it. If you have a better place to put them, I'm happy to change
   the PR.

Feel free to make any changes to this PR if you like before landing it, or to
ask for review.

As a followup I'm also happy to set up a cross-compile build for atuin on
illumos. It's a bit harder to run tests in CI for illumos at the moment, but
I'm trying to get a project started up to make that happen in the future as
well.
2024-03-05 09:49:40 +00:00
Ellie Huxtable
3d6b163546
fix(tz): attempt to fix timezone reading (#1810) 2024-03-02 17:05:04 +00:00
Anderson
9933220dac
feat(ui): Add config setting for showing tabs (#1755)
* Add config setting for showing tabs

* Added semicolon
2024-03-01 14:57:18 +00:00
依云
aec5df4123
feat: support regex with r/.../ syntax (#1745)
* feat: support regex with r/.../ syntax

* cargo fmt

* feat(tests): add some tests for regex matching
2024-03-01 13:21:53 +00:00
Helmut K. C. Tessarek
94c85c3189
feat(stats): add linux sysadmin commands to common_subcommands (#1784)
* feat(stats): add linux sysadmin commands to common_subcommands

I've been using atuin on my Linux box for some time now and I have
noticed that a few commands that are used rather often are not in the
list of common_subcommands.
This change adds these commands to the list.

* feat(stats): I forgot 'apt'
2024-02-27 13:27:39 +00:00
Sandro
cc964861c4
feat(stats): Normalize formatting of default config, suggest nix (#1764)
* Normalize formatting

This makes the commented bits unifed and makes lists multiline and
always adds the trailing comma.

* Add nix to default config

Since we are big fans of it ;)
2024-02-26 14:58:22 +00:00
Korvin Szanto
d7582b62fd
feat: Add PHP package manager "composer" to list of default common subcommands (#1757)
* Add PHP package manager "composer" to list of default common subcommands

* Run cargo fmt and sort entries
2024-02-26 11:59:34 +00:00
Ellie Huxtable
cf09464d4d
chore(release): prepare for release v18.0.2 (#1775) 2024-02-26 11:37:54 +00:00
Aloxaf
21fee97a62
fix(import/zsh-histdb): missing or wrong fields (#1740)
* fix(import/zsh-histdb): import exit_status and session

* fix(import/zsh-histdb): avoid session id conflict

* fix(import/zsh-histdb): follow the format conventions of session and hostname

* fix(import/zsh-histdb): duration unit is nanosecond
2024-02-21 08:56:41 +00:00
Helmut K. C. Tessarek
56b971ae19
feat(client): add config option keys.scroll_exits (#1744)
* feat(client): add config option keys.scroll_exits

If the config option is set the `false`, using the up/down key won't
exit the TUI when scrolled past the first/last entry.

Example:

```
[keys]
scroll_exits = false
```

The default is `true`, which is the current behavior.

* Update atuin/src/command/client/search/interactive.rs

Co-authored-by: Koichi Murase <myoga.murase@gmail.com>

* refactor: add option to config.toml

---------

Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
2024-02-21 08:25:55 +00:00
Onè
409456fce1
fix: typo (#1741) 2024-02-20 12:54:48 +00:00
依云
2a65f89cd5
feat: change fulltext to do multi substring match (#1660) 2024-02-19 11:03:09 +00:00
jfmontanaro
4512cd5c7f
fix(xonsh): Add xonsh to auto import, respect $HISTFILE in xonsh import, and fix issue with up-arrow keybinding in xonsh (#1711)
* add xonsh to `atuin import auto`

* respect $HISTFILE in xonsh importers

* disable up-arrow binding in xonsh when completion menu is active

* include xonsh logic in the same conditional as other shells

* format and fix clippy lints
2024-02-15 19:33:30 +00:00
David
f8d01eef99
feat: add 'ignored_commands' option to stats (#1722) 2024-02-15 18:52:19 +00:00
jfmontanaro
87e19df9c5
feat: Add xonsh history import (#1678)
* add importers for xonsh JSON files and SQLite db

* rustfmt xonsh importers

* remove env-dependent tests from xonsh importers

* pass xonsh_data_dir into path resolver instead of looking up in env

* review: run format

* review: fix clippy errors

---------

Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2024-02-12 10:32:07 +00:00
Ellie Huxtable
8ef5f67f8b
perf: optimize history init-store (#1691)
Instead of lots of small sqlite transaction, do one monster one.

A single tx with 100s of 1000s of rows should be fine on all systems

A very unscientific test shows this to be roughly 10x faster
2024-02-12 09:56:42 +00:00
David
b4f8d1433b
docs: minor formatting updates to the default config.toml (#1689) 2024-02-12 09:26:29 +00:00
Eric Long
5a805dc22c
feat: use ATUIN_TEST_SQLITE_STORE_TIMEOUT to specify test timeout of SQLite store (#1703)
Low-end devices like RISC-V SBCs are sometimes too slow to initialize SQLite in 0.1s. Option to specify a higher value allows check to pass on such devices with relaxed restrictions.
2024-02-12 09:25:06 +00:00
Ellie Huxtable
1464cb657a
chore(release): prepare for release v18.0.1 (#1706) 2024-02-12 08:38:23 +00:00
Ellie Huxtable
5738d06282
chore(release): prepare for release v18.0.0 (#1685) 2024-02-09 12:42:34 +00:00
Ellie Huxtable
8460210202
feat: add progress bars to sync and store init (#1684)
Replace lots of logging with some progress bars. This looks much nicer

I'd like to move it out of the atuin-client crate and into the atuin
crate. But first, I want to decouple a lot of the record moving, so it
can wait until that's done.
2024-02-08 13:34:41 +00:00
Ellie Huxtable
1993653102
fix(tests): add Settings::utc() for utc settings (#1677)
Means we don't try and load timezones in tests, as this fails due to
multiple threads.

Also allow specifying '0' or 'utc' as a timezone
2024-02-06 17:47:00 +00:00
cyqsimon
318bdd8955
Add timezone configuration option & CLI overrides (#1517)
* Allow specifying a timezone in history search/list

* Fix clippy complaints

* Add a bit more comment on supporting named timezones

* Add rudimentary tests

* Ditch local timezone test

* Timezone configuration support

* Set default timezone to `local`

* `--tz` -> `--timezone`

`--tz` is kept as a visible alias
2024-02-06 15:34:03 +00:00
Ellie Huxtable
6a2576fc5b
chore(ci): run rust build/test/check on 3 platforms (#1675)
* chore(ci): run rust build/test/check on 3 platforms

* need to properly test windows

* do not need to strip here, and windows has a suffix anyway
2024-02-05 09:28:55 +00:00
Ellie Huxtable
3ff2e2552f
fix: correct download list for incremental builds (#1672) 2024-02-04 20:06:47 +00:00
Joe Ardent
b7bb583d8d
fix: set durability for sqlite to recommended settings (#1667)
Also do an optimize on connection close. Fixes lag on history insertion.
2024-02-04 18:42:48 +00:00
Ellie Huxtable
374255dd58 feat: add store pull
This allows the user to

1. Specify that they want to sync, but ONLY pull new data
2. Specify that they wish to force pull, which will wipe the local store
   and download it from the remote

With the other set of changes, this allows the user to perform
sufficient maintenance to recovery from most errors I can think of right
now.
2024-02-02 18:01:09 +00:00
Ellie Huxtable
c9a453289e feat: add store push --force
This will

1. Wipe the remote store
2. Upload all of the local store to remote

Imagine the scenario where you end up with some mixed keys locally :(

You confirm this with

```
atuin store verify
```

You then fix it locally with

```
atuin store purge
```

Ensure that your local changes are reflected remotely with

```
atuin store push --force
```

and then (another PR, coming soon), update all other hosts with

```
atuin store pull --force
```
2024-02-02 18:01:09 +00:00
Ellie Huxtable
3c420f85f6 feat: failure to decrypt history = failure to sync
Now that the user can purge their store and _do something_ about invalid
records, we should not tolerate mixed key records in store.
2024-02-02 18:01:09 +00:00
Ellie Huxtable
754f17ddb4 feat: add store purge command
This command will delete all records from the local store that cannot be
decrypted with the current key.

If a verify fails before running this, it should pass _after_ running
it.

Required afterwards:
- A `push --force`, to allow ensuring the remote store equals the local
  store (deletions have now occured!)
- A `pull --force`, as once remote has been forced then local needs the
  same

Nice to have:
- Provide "old" keys to purge, in case the are not lost. Or maybe rekey.
2024-02-02 18:01:09 +00:00
Ellie Huxtable
212dc928c9 feat: add verify command to local store
This ensures that the local store can be decrypted with the current
in-use key.

If it cannot, we can go on to perform maintenance operations and get
back into a happy state.
2024-02-02 18:01:09 +00:00
Conrad Ludgate
744f0059c2
feat: add prefers_reduced_motion flag (#1645)
* feat: add prefers_reduced_motion flag

* use NO_MOTION, and ensure type is bool

* update default config

---------

Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2024-02-01 15:17:29 +00:00
Ellie Huxtable
a6f1fe2c10
feat: reencrypt/rekey local store (#1662)
* feat: add record re-encrypting

* automatically re-encrypt store when logging in with a different key

* fix

* actually save the new key lmao

* add rekey

* save new key

* decode bip key

* "add test for sqlite store re encrypt"
2024-02-01 15:00:46 +00:00
Ellie Huxtable
335f2220c3
fix: never overwrite the key (#1657)
Now that local history is stored encrypted, new_key should not overwrite
an existing one. This may be frustrating, but will remove the risk of
Atuin generating a new key and the user losing their old one.
2024-01-30 14:01:20 +00:00
Ellie Huxtable
9597080825
feat: add store push (#1649)
* feat: add store push

* only push for the current host unless specified

* tidy up

* tidy up some more

* sort features
2024-01-30 13:41:01 +00:00
Ellie Huxtable
366b8ea97b
feat: automatically init history store when record sync is enabled (#1634)
* add support for getting the total length of a store

* tidy up sync

* auto call init if history is ahead

* fix import order, key regen

* fix import order, key regen

* do not delete key when user deletes account

* message output

* remote init store command; this is now automatic

* should probs make that function return u64 at some point
2024-01-29 16:38:24 +00:00