Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty history with sqlite file_format #9438

Open
DarkPark opened this issue Jun 14, 2023 · 7 comments
Open

Empty history with sqlite file_format #9438

DarkPark opened this issue Jun 14, 2023 · 7 comments
Labels
history Related to the history needs-triage An issue that hasn't had any proper look

Comments

@DarkPark
Copy link

Describe the bug

The default plaintext file_format allows to see command history either by Ctrl+r or navigate history list with up/down arrows.
After switching to sqlite seems there are only session command history available with up/down arrows. Ctrl+r still shows full history.

How to reproduce

  1. Set plaintext file_format in config and restart nushell.
  2. Execute some commands and restart nushell.
  3. Press up to see executed earlier commands (normal expected behavior).
  4. Set sqlite file_format in config and restart nushell.
  5. Execute some commands and restart nushell.
  6. Press up and get no history (wrong behavior).

Expected behavior

Full command history should be available in any file_format.

Screenshots

No response

Configuration

| key                | value                                                   |
| ------------------ | ------------------------------------------------------- |
| version            | 0.81.0                                                  |
| branch             |                                                         |
| commit_hash        | 5c81bcef1a3c1667468c81ef8c06cf56a0962133                |
| build_os           | linux-x86_64                                            |
| build_target       | x86_64-unknown-linux-gnu                                |
| rust_version       | rustc 1.68.2 (9eb3afe9e 2023-03-27)                     |
| rust_channel       | 1.68.2-x86_64-unknown-linux-gnu                         |
| cargo_version      | cargo 1.68.2 (6feb7c9cf 2023-03-26)                     |
| build_time         | 2023-06-06 22:55:22 +00:00                              |
| build_rust_channel | release                                                 |
| features           | default, sqlite, static-link-openssl, trash, which, zip |
| installed_plugins  |                                                         |

Additional context

No response

@DarkPark DarkPark added the needs-triage An issue that hasn't had any proper look label Jun 14, 2023
@fdncred
Copy link
Collaborator

fdncred commented Jun 14, 2023

I think what you're experiencing is this config setting

    history_isolation: false # true enables history isolation, false disables it. history_isolation is a unique history per session.

@DarkPark
Copy link
Author

@fdncred I didn't change this option at all since nushell install
and afaik anyway this option is about new commands (not already present in the history)

@sholderbach sholderbach added the history Related to the history label Jun 15, 2023
@fdncred
Copy link
Collaborator

fdncred commented Jun 15, 2023

is your history_isolaion set to true or false?

This statement

After switching to sqlite seems there are only session command history available with up/down arrows. Ctrl+r still shows full history.

Says to me that it's set to true because that's how it works when it's true. If you don't want it to work that way, you can try setting it to false.

@DarkPark
Copy link
Author

@fdncred as I said - no change from default
history_isolation: true is set all the time for both plaintext and sqlite option
this history_isolation behavior has more sense and it's very sad to make hard choice: sqlite or history_isolation but not both

@fdncred
Copy link
Collaborator

fdncred commented Jun 15, 2023

I don't think I understand what you're saying. I'm missing something.

I don't have any issues with history_isolation = false. ctrl+r/hints sees the full history. up/down arrow sees the full history.

history_isolation = true does nothing in plaintext mode. It's exclusively for sqlite.

history_isolation = true only works in sqlite and isolates your history to each nushell session. ctrl+r and hints will still see the entire history but up/down will only see the history from the current nushell session. This is how it's supposed to work. If it's not doing this, then there may be a bug.

@DarkPark
Copy link
Author

@fdncred thanks for clarification.
It was absolutely not clear that history_isolation affects only sqlite.
But why not load all history from the start in this mode? Isolation is good to protect from unexpected commands from another nushell instance. But when I start it's totally normal to load everything at once.
Moreover ctrl+r shows full history anyway.

@fdncred
Copy link
Collaborator

fdncred commented Jun 15, 2023

But why not load all history from the start in this mode? Isolation is good to protect from unexpected commands from another nushell instance. But when I start it's totally normal to load everything at once.

We're probably accept a PR for this change.

Glad we're finally understanding each other. LOL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
history Related to the history needs-triage An issue that hasn't had any proper look
Projects
None yet
Development

No branches or pull requests

3 participants