Code Monkey home page Code Monkey logo

atuin's People

Contributors

akinomyoga avatar arcuru avatar baprx avatar conradludgate avatar cyqsimon avatar deicon avatar dependabot[bot] avatar ellie avatar frankh avatar github-actions[bot] avatar incognito124 avatar jirutka avatar leoniephiline avatar lilydjwg avatar majutsushi avatar mozzieongit avatar nemo157 avatar orhun avatar pdecat avatar s0 avatar sciencentistguy avatar stevenxxiu avatar supersandro2000 avatar takac avatar tessus avatar tobiasge avatar tpoliaw avatar utterstep avatar yummyoreo avatar yuvipanda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atuin's Issues

integrate with fzf

Unfortunately , I tried tui search , but still want to use fzf history search .
I am trying to integrate with fzf using history list , it throws following error .
Can u please help ?
Thanks

[master:.configfiles] atuin history list
Error: environment variable not found

Location:
src/command/history.rs:151:56

Key creation order

I found the key creation order to be a little confusing. It isn't created when you register, but when you sync the first time. So I tried to register, then login, and I couldn't find where the key was that I needed to use.

Support full text search of commands

AMAZING PROJECT!

Regular Ctrl+R seems to give me full text search, matching words I type to any part my history of commands. For example, <Ctrl+R>ge will match kubectl -n test get pod because of the get. However, to get similar match in atuin, I need to type *ge.

Would you be open to adding a config parameter / commandline flag that does full text search by default?

Add searching

Allow searching for certain strings in history. Would be neat to include regex too!

Something like

atuin search grep

could list all commands that include the word grep, with

atuin search ^grep

including all commands that begin with grep

Better/more expressive search filters

Currently, it seems that search filters are quite limited. For instance, you can only have 1 optional directory filter. Also, for interactive mode, you cannot update these filters while in the tui.

I think this would ultimately require a large rewrite of the search code.

Current filters:

  • cwd
  • exclude_cwd
  • exit
  • exclude-exit
  • before
  • after

These all currently only accept up to a single value and they're all duplicated with this conflicting filters.

I'm imagining a system like atuin search cwd not "$HOME" and time between 2021-04-01 and 2021-05-01

And then there could be a keybinding in the interactive mode to replace the text box with the filter editor.

Write some proper tests

Hah, what are tests?

No but seriously - now that some people actually use this (!!!) we definitely need some actual tests, beyond the super minimal set of unit tests there at the moment.

A few end to end things that test whether or not the main features generally work would be ideal

proposal: Entry deletion

Currently the history is a permanent log of everything submitted to the shell. In some circumstances it may be necessary to either delete select entries, a large batch of entries or even the entire history.

Such circumstances may include:

  • Authentication tokens
  • Passwords
  • Personal information

Implement search modes

Required for #118

This should be configurable, and set whether the Atuin TUI searches globally/by directory/by session

Set by flag, or set by config

Use shellcheck on all shell scripts

And also add a CI step that uses it!

There's been a couple of install script issues that could have been totally avoided.

I'd also like to make sure the init scripts are correct

Optimise sqlite

Could probably adjust PRAGMA synchronous and enable WAL.

Currently there's basically 0 optimisation in both database config + database queries, and performance is still Good Enough (for my uses).

Option to disable rebinds

atuin init <shell> rebinds up and ctrl+r by default.
There should be an option to disable one of them.

Panic shortly after importing

Performing these two actions consistently gets me a panic

 oon@altair  ~/code/rust/atuin   main  rm ~/.local/share/atuin/history.db
 oon@altair  ~/code/rust/atuin   main  atuin import zsh
        Atuin
======================
          🌍
       🐘🐘🐘🐘
          🐢
======================
Importing history...
Importing history from zsh
Import complete!

Followed by Up

 oon@altair  ~/code/rust/atuin   main  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: OutOfRangeError(())', src/command/search.rs:45:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

https://github.com/ellie/atuin/blob/de2e34ac50/src/command/search.rs#L45

This seems to occur when chrono::Utc::now().sub(h.timestamp) is negative. I'm not sure why, perhaps there's a discrepancy in the ~/.zsh_history file where the timestamps are possibly a couple seconds in the future

    pub fn to_std(&self) -> Result<StdDuration, OutOfRangeError> {
        if self.secs < 0 {
            return Err(OutOfRangeError(()));
        }
        Ok(StdDuration::new(self.secs as u64, self.nanos as u32))
    }

Support bash

I'd love to support Bash! Three things are needed for this

  • write a plugin for bash
  • handle importing simple bash history
  • handle importing bash history with custom HISTTIMEFORMAT

Ctrl-r to switch search modes

When in the search UI, a user should be able to press Ctrl-r to switch search modes

These three modes should be:

  • global
  • directory
  • session

where global searches all shell history, directory searches for all history in the current directory, and session searches for all history in the current session

Powershell Support

I absolutely love the project and would love to be able to use it within powershell

How to uninstall atuin?

I have installed the Atuin successfully. But it seems not usable for me now. So I want to uninstall it. But I did not find any documents about this........

Fix deb release filenames

See #46 for context!

Currently the release file builder names does not include the v in the version part filename

For instance, we currently have atuin_0.6.4_amd64.deb, when really what we want is atuin_v0.6.4_amd64.deb

cargo-deb is used to generate the debian package, it might have an option for configuring the filename - otherwise the release pipeline will need changing

Once done, #46 can be reverted

Implement sync

This is essentially the other half of the core functionality. Not only should A'tuin manage the history for your local machine, it should sync history for all of your machines

The server

Implement a server. The command + rocket are already setup, just the rest needs doing.

  • take POST of history items, store in a database
  • some sort of auth (public/private key?)
  • allow GET queries for all items after a certain date (likely the last time it was called)

The client

  • After every command, fork another process that POSTs the details up to the server.
  • Check for new commands afterwards.
  • Perhaps the POST response could indicate if a following GET is needed

Encryption

All history data should be encrypted. 100%.

So in all, the server is very little than a blob store!

Have `login` check for current session

It would be nice if login would print that "You're already logged in with a valid session token" if already logged in. Maybe either have a command or option to log out, or a [Y/n] question to log out if logged in.

Explicit rustup make dependency in aur pkgbuild

Right now if you have rust installed using anything but rustup the aur helper will ask to replace it with rustup. To avoid this, the package should depend on cargo or rust, this way any package that provides it will work, including rustup. See the make dependencies of package as an example.

Diff for changing the makedeps and also adding the Upstream URL of the project:

 pkgname=atuin
 pkgver=0.6.4
 pkgrel=1
-makedepends=('rustup')
+makedepends=('cargo')
 arch=('i686' 'x86_64' 'armv6h' 'armv7h')
 pkgdesc="atuin - magical shell history"
+url="https://github.com/ellie/atuin"
 license=('MIT')

See history for only commands issued in a directory (or subdirectories)

I do Android development and electron development. The history for each is entirely independent. It would be useful when I'm in the directory where I do Android development to only see the commands related to Android. And similarly for when I'm working in the electron directory.

Maybe this could be accomplished with a command flag or a dot file in the directory or parent directories.

possibly a bug: install script broke my .zshrc

Hey there 👋 This is really a nice project and just like what I needed. I did the installation using the install script, at the end my ~/.zshrc ended up like this:

alias some_cmd="some args"eval "$(atuin init zsh)"

This happened because my earlier version must have not ended with a newline. May be I edited it and forgot to add a newline. I am happy to send a patch which manually adds a new line, but I was not so sure. Because this is not a bug if ~/.zshrc files are expected to ended with a newline. Also, I am not really sure how do other install scripts behave.

Log to file

Update our logger to write to a file as well as stdout to help with debugging. (see #79)

concern: sqli (on client)

The assembly of SQL strings takes unprotected input from the environment / user
context. This is on the client side (where it's less of a concern because I
already own the db file, but still):

src/command/history.rs:

  let session = env::var("ATUIN_SESSION")?;
  let query_session = format!("select * from history where session = {};", session);

I'm worried that even aside from malicious concerns, users could trip over these in normal operation. One of these queries uses cwd and perhaps a user has a semicolon or backtick or similar similar special character in the dir name. (I got a little stuck on the bash integration when trying to test this; will update when I get past that).

On the server side (at a quick glance) where the input comes from the network,
it's ok; using SQLx and prepared statement bindings.

Make C-r closer to stock

When atuin is launched by C-r, it treats the pattern as a shell glob, which means (absent any globs) it performs a prefix match on the history. The shell's default C-r behavior meanwhile is a substring match, so e.g. C-r debug would match make debug in bash, but not in atuin.

To make atuin's behavior closer to the shell's normal behavior, I'd like to suggest that an implicit * be prepended to the pattern iff the pattern doesn't contain any shell globs. This is also similar to how the shell's stock C-r behavior is case-insensitive unless the pattern contains an uppercase character.

Add SQL search mode

It can be really useful to search the local Atuin history database via SQL queries

Extend atuin search with a --sql flag - this should allow entering raw SQL queries.

Additionally, the interactive UI should support SQL queries + perhaps prefill with an example. For instance, typing make, and pressing Up should show the search UI, with the query box having SELECT * from history where command like 'make%'; or something like that. This should be configurable, and not the default

Otherwise we can then address the concerns in #55, and ensure all other queries are prepared statements!

Do away with FZF usage

We already have everything in a database! It shouldn't be too much work to use a SQL query instead of listing everything and piping to FZF, and we will also gain a lot in performance

Also! Considering using the SQLite FTS module :)

Add stats summary

Instead of atuin stats all, it should have the same functionality but just for atuin stats. A little neater and more intuitive that way.

atuin stats day 01/01/2021 could then become atuin stats 01/01/2021

Allow ignoring commands

This should be implemented similar to default shell history - any command beginning with a space should not be recorded to history

Add individual crate build to CI

We managed to find a situation with the 0.7.0 release where atuin-common would build when built as a dependency of the main atuin crate, however it would not build when built by itself.

This meant it was impossible to publish to crates.io, and the release process could not be completed!

Because of this, CI should test the build of each dependent crate separately to the build of the entire project

Key binding to run the command immediately

It'd be nice if there were a key binding that somehow ran the selected command immediately instead of simply placing it on the command line. Having to hit enter twice to run a command I don't want to modify is a tad annoying.

If query is not found, should insert it in shell on enter

Started using atuin on my terminal, it's a very nice tool!

What would be great is if one enters a command that's not found in the history and then presses [ENTER] to go back to the terminal, the entered text in the history prompt should appear again on the command line prompt. I miss this feature because it's the default behavior of CTRL+R reverse search in ZSH (which this tool also overrides).

zsh multiline import broken

I entered echo \<NEWLINE>bar into my zsh terminal, and the resulting ~/.zsh_history entry contained the lines

: 1620636746:0;echo \\
bar

With two \ tokens. The current import isn't taking this into account. The command is saved with both \\ characters and is interpreted differently.

This possibly impacts bash import too.

Note, any new entries don't have this issue. This is only for import

SSH Sync

It would be good to have a more simple peer-to-peer sync between instances on
machines I can ssh to, e.g something like: atuin remote {push, pull, sync} HOST

That would basically run ssh HOST atuin remote serve and then do the sync
exchange over stdio rather than http. Then I can just replicate history around
machines as I log into them. Apart from not actually needing a server, this also
addresses cases where a common server isn't reachable, or would only be
reachable via setting up ssh tunnels over the same connections anyway.

The HOST arg of course could be user@host, and more complex options can be
handled with aliases in ~/.ssh/options. In case another stdio-style transport
is added later, a --ssh option can be built into the command structure and
assumed the default for compatibility.

`cargo build` fails

I cloned the repo and tried to build it as is with cargo build. It fails with the following error:

   Compiling atuin-client v0.6.2 (/Users/yuvipanda/code/atuin/atuin-client)
error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:141:19
    |
141 |           let res = sqlx::query("select * from history where id = ?1")
    |  ___________________^
142 | |             .bind(id)
143 | |             .map(Self::query_history)
144 | |             .fetch_one(&self.pool)
    | |__________________________________^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:144:14
    |
144 |             .fetch_one(&self.pool)
    |              ^^^^^^^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:143:14
    |
143 |             .map(Self::query_history)
    |              ^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: expected a `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
   --> atuin-client/src/database.rs:141:19
    |
141 |           let res = sqlx::query("select * from history where id = ?1")
    |  ___________________^
142 | |             .bind(id)
143 | |             .map(Self::query_history)
144 | |             .fetch_one(&self.pool)
145 | |             .await?;
    | |__________________^ expected an `FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
    | 
   ::: /Users/yuvipanda/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.5.2/src/query.rs:121:27
    |
121 |       ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<O, Error> + Send, A>
    |                             ---------------------------------- required by this bound in `sqlx::query::Query<'q, DB, A>::map::{{opaque}}#0`
    |
    = help: the trait `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` is not implemented for `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:202:19
    |
202 |           let res = sqlx::query(query.as_str())
    |  ___________________^
203 | |             .map(Self::query_history)
204 | |             .fetch_all(&self.pool)
    | |__________________________________^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:204:14
    |
204 |             .fetch_all(&self.pool)
    |              ^^^^^^^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:203:14
    |
203 |             .map(Self::query_history)
    |              ^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: expected a `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
   --> atuin-client/src/database.rs:202:19
    |
202 |           let res = sqlx::query(query.as_str())
    |  ___________________^
203 | |             .map(Self::query_history)
204 | |             .fetch_all(&self.pool)
205 | |             .await?;
    | |__________________^ expected an `FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
    | 
   ::: /Users/yuvipanda/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.5.2/src/query.rs:121:27
    |
121 |       ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<O, Error> + Send, A>
    |                             ---------------------------------- required by this bound in `sqlx::query::Query<'q, DB, A>::map::{{opaque}}#0`
    |
    = help: the trait `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` is not implemented for `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:217:19
    |
217 |           let res = sqlx::query(
    |  ___________________^
218 | |             "select * from history where timestamp >= ?1 and timestamp <= ?2 order by timestamp asc",
219 | |         )
220 | |         .bind(from)
221 | |         .bind(to)
222 | |             .map(Self::query_history)
223 | |         .fetch_all(&self.pool)
    | |______________________________^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:223:10
    |
223 |         .fetch_all(&self.pool)
    |          ^^^^^^^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:222:14
    |
222 |             .map(Self::query_history)
    |              ^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: expected a `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
   --> atuin-client/src/database.rs:217:19
    |
217 |           let res = sqlx::query(
    |  ___________________^
218 | |             "select * from history where timestamp >= ?1 and timestamp <= ?2 order by timestamp asc",
219 | |         )
220 | |         .bind(from)
...   |
223 | |         .fetch_all(&self.pool)
224 | |         .await?;
    | |______________^ expected an `FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
    | 
   ::: /Users/yuvipanda/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.5.2/src/query.rs:121:27
    |
121 |       ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<O, Error> + Send, A>
    |                             ---------------------------------- required by this bound in `sqlx::query::Query<'q, DB, A>::map::{{opaque}}#0`
    |
    = help: the trait `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` is not implemented for `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:231:13
    |
231 | /             sqlx::query("select * from history where duration >= 0 order by timestamp asc limit 1")
232 | |                 .map(Self::query_history)
233 | |                 .fetch_one(&self.pool)
    | |______________________________________^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:233:18
    |
233 |                 .fetch_one(&self.pool)
    |                  ^^^^^^^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:232:18
    |
232 |                 .map(Self::query_history)
    |                  ^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: expected a `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
   --> atuin-client/src/database.rs:231:13
    |
231 | /             sqlx::query("select * from history where duration >= 0 order by timestamp asc limit 1")
232 | |                 .map(Self::query_history)
233 | |                 .fetch_one(&self.pool)
234 | |                 .await?;
    | |______________________^ expected an `FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
    | 
   ::: /Users/yuvipanda/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.5.2/src/query.rs:121:27
    |
121 |       ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<O, Error> + Send, A>
    |                             ---------------------------------- required by this bound in `sqlx::query::Query<'q, DB, A>::map::{{opaque}}#0`
    |
    = help: the trait `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` is not implemented for `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:240:19
    |
240 |           let res = sqlx::query(
    |  ___________________^
241 | |             "select * from history where duration >= 0 order by timestamp desc limit 1",
242 | |         )
243 | |         .map(Self::query_history)
244 | |         .fetch_one(&self.pool)
    | |______________________________^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:244:10
    |
244 |         .fetch_one(&self.pool)
    |          ^^^^^^^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:243:10
    |
243 |         .map(Self::query_history)
    |          ^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: expected a `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
   --> atuin-client/src/database.rs:240:19
    |
240 |           let res = sqlx::query(
    |  ___________________^
241 | |             "select * from history where duration >= 0 order by timestamp desc limit 1",
242 | |         )
243 | |         .map(Self::query_history)
244 | |         .fetch_one(&self.pool)
245 | |         .await?;
    | |______________^ expected an `FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
    | 
   ::: /Users/yuvipanda/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.5.2/src/query.rs:121:27
    |
121 |       ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<O, Error> + Send, A>
    |                             ---------------------------------- required by this bound in `sqlx::query::Query<'q, DB, A>::map::{{opaque}}#0`
    |
    = help: the trait `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` is not implemented for `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:251:19
    |
251 |           let res = sqlx::query(
    |  ___________________^
252 | |             "select * from history where timestamp < ?1 order by timestamp desc limit ?2",
253 | |         )
254 | |         .bind(timestamp.timestamp_nanos())
255 | |         .bind(count)
256 | |         .map(Self::query_history)
257 | |         .fetch_all(&self.pool)
    | |______________________________^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:257:10
    |
257 |         .fetch_all(&self.pool)
    |          ^^^^^^^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:256:10
    |
256 |         .map(Self::query_history)
    |          ^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: expected a `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
   --> atuin-client/src/database.rs:251:19
    |
251 |           let res = sqlx::query(
    |  ___________________^
252 | |             "select * from history where timestamp < ?1 order by timestamp desc limit ?2",
253 | |         )
254 | |         .bind(timestamp.timestamp_nanos())
...   |
257 | |         .fetch_all(&self.pool)
258 | |         .await?;
    | |______________^ expected an `FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
    | 
   ::: /Users/yuvipanda/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.5.2/src/query.rs:121:27
    |
121 |       ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<O, Error> + Send, A>
    |                             ---------------------------------- required by this bound in `sqlx::query::Query<'q, DB, A>::map::{{opaque}}#0`
    |
    = help: the trait `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` is not implemented for `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:275:19
    |
275 |           let res = sqlx::query(
    |  ___________________^
276 | |             format!(
277 | |                 "select * from history h
278 | |             where command like ?1 || '%' 
...   |
289 | |         .map(Self::query_history)
290 | |         .fetch_all(&self.pool)
    | |______________________________^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:290:10
    |
290 |         .fetch_all(&self.pool)
    |          ^^^^^^^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:289:10
    |
289 |         .map(Self::query_history)
    |          ^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: expected a `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
   --> atuin-client/src/database.rs:275:19
    |
275 |           let res = sqlx::query(
    |  ___________________^
276 | |             format!(
277 | |                 "select * from history h
278 | |             where command like ?1 || '%' 
...   |
290 | |         .fetch_all(&self.pool)
291 | |         .await?;
    | |______________^ expected an `FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
    | 
   ::: /Users/yuvipanda/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.5.2/src/query.rs:121:27
    |
121 |       ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<O, Error> + Send, A>
    |                             ---------------------------------- required by this bound in `sqlx::query::Query<'q, DB, A>::map::{{opaque}}#0`
    |
    = help: the trait `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` is not implemented for `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:297:19
    |
297 |           let res = sqlx::query(query)
    |  ___________________^
298 | |             .map(Self::query_history)
299 | |             .fetch_all(&self.pool)
    | |__________________________________^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:299:14
    |
299 |             .fetch_all(&self.pool)
    |              ^^^^^^^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0271]: type mismatch resolving `<sqlx::Sqlite as sqlx::Database>::Row == <sqlx::Sqlite as sqlx::Database>::Row`
   --> atuin-client/src/database.rs:298:14
    |
298 |             .map(Self::query_history)
    |              ^^^ expected struct `sqlx::sqlite::SqliteRow`, found associated type
    |
    = note:       expected struct `sqlx::sqlite::SqliteRow`
            found associated type `<sqlx::Sqlite as sqlx::Database>::Row`
    = help: consider constraining the associated type `<sqlx::Sqlite as sqlx::Database>::Row` to `sqlx::sqlite::SqliteRow`
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error[E0277]: expected a `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
   --> atuin-client/src/database.rs:297:19
    |
297 |           let res = sqlx::query(query)
    |  ___________________^
298 | |             .map(Self::query_history)
299 | |             .fetch_all(&self.pool)
300 | |             .await?;
    | |__________________^ expected an `FnMut<(sqlx::sqlite::SqliteRow,)>` closure, found `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`
    | 
   ::: /Users/yuvipanda/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.5.2/src/query.rs:121:27
    |
121 |       ) -> Map<'q, DB, impl FnMut(DB::Row) -> Result<O, Error> + Send, A>
    |                             ---------------------------------- required by this bound in `sqlx::query::Query<'q, DB, A>::map::{{opaque}}#0`
    |
    = help: the trait `std::ops::FnMut<(sqlx::sqlite::SqliteRow,)>` is not implemented for `impl std::marker::Send+std::ops::FnMut<(<sqlx::Sqlite as sqlx::Database>::Row,)>`

error: aborting due to 32 previous errors

Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
error: could not compile `atuin-client`.

To learn more, run the command again with --verbose.

Rust version is rustc 1.46.0 (04488afe3 2020-08-24)

Config file

We could do with a config file! To begin with this would be useful for configuring the "dialect" used by chrono-english

Later on it would be very helpful for configuring history sync

Perhaps using this: https://github.com/mehcode/config-rs

Improve search command

As suggested by @conradludgate in #112, the search command could be improved!

The current filters should be accepted more than once. So atuin search --exit 1 --exit 0 should return commands with exit codes 1, and exit codes 0

Add push/pull only sync config

Add two options to the client config file:

eg

sync_push = false
sync_pull = true

This would be useful on work computers where sharing shell history would be against corporate policy, but being able to download your history from personal devices would be useful

Fuzzier search

Right now, the ^r (atuin search -i) behavior searches for strings with matching prefixes; I'd like it to search for substrings.

Ie, terr should match both terraform plan and git commit -a -m '[terraform] do the thing'.

Very long history import time with 132k line zsh history file

About 17 hours ago (!), I ran atuin import zsh, with $HISTFILE set to $HOME/.zshrc. My history file has 132,450 raw lines (115,029 actual entries, because of multiline commands). Each command has the timestamp (e.g. 1600602281) and the run duration in seconds.

The format for each entry is—

: 1600602281:0;command --args

FYI—Some of the commands have strange text in (this output is from less):

<BA>Ã<A9>© <BA>Ã<A9>®´ <BA>Ã<A9>®Ã<A9>⃨<AB>⃨<83><BA>Ã<A9>©¬©¬¨⃨<83><BA>Ã<A9>¶ <BA>Ã<A9>®Ã<A9>⃨<AB>⃨<83><BA>Ã<A9>©⃨<83><BA>Ã<A9>øcxxxxxxxjjjjjjjjjj <BA>Ã<A4>Ã<A9>⃨<AB>⃨<83><BA>Ã<A9>§⃨<83><BA>Ã<A9>© <BA>Ã<A9>®´ <BA>Ã<A9>®Ã<A9>⃨<AB>⃨<83><BA>Ã<A9>©
¬Ã<BF> <BA>Ã<A9>®Ã<A9>⃨<AB>⃨<83><BA>Ã<A9>©¬

It's still going. Any way to fix this and get my 115k zsh history entries into atuin?

Fish support

Will be great if fish shell can be supported as well

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.