warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.11k stars 360 forks source link

History is lost #5212

Open FrenchBen opened 1 month ago

FrenchBen commented 1 month ago

Dupe Check

Describe the bug

Despite history files existing, several shell env changes, history in Warp isn't retained. The question then is: Where is the actual history preference set within Warp?

To reproduce

  1. Use wap
  2. Execute several "similar" commands like curl ...
  3. Expect warp to recall older curl commands

Expected behavior

Warp should remember everything since the beginning of time :)

Screenshots

No response

Operating system

MacOS

Operating system and version

14.5

Shell Version

zsh 5.9

Current Warp version

v0.2024.07.16.08.02.stable_03

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

No

Is this an issue only in Warp?

Yes, I confirmed that this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

FrenchBen commented 1 month ago

Not only is history from Zsh not respected, the history written to the HISTFILE isn't shared across tabs or pane, rendering cross-tab functionality painful.

Replicate bug

  1. Create 2 tabs (or pane)
  2. Type something
  3. Try to get the history of what you typed from another pane

Histfile will show the command: Screenshot 2024-08-14 at 10 28 51

yet Warp cannot "find it" Screenshot 2024-08-14 at 10 28 39

Screenshot 2024-08-14 at 10 28 26

dannyneira commented 1 month ago

Hi @FrenchBen sorry to hear about this. Warp doesn't share history immediately across sessions, although this setting may be enabled in your zsh config. Currently, Warp does read the HISTFILE upon loading a new session, so any commands you ran in other sessions should show up when you open a new window/tab/pane.

FrenchBen commented 1 month ago

@dannyneira thank you for your note - How does Warp save its history if not written to the HISTFILE directly, which would make it cross-session? Is this an issue of the history being written, but Warp not re-loading it?

dannyneira commented 1 month ago

How does Warp save its history if not written to the HISTFILE directly, which would make it cross-session?

Yes they are written to the HISTFILE as with normal terminals, but the history doesn't get consolidated across existing sessions (regardless of rc file settings), they only get combined when a new session is made.

Is this an issue of the history being written, but Warp not re-loading it?

Warp does reload the history and consolidate it, on new sessions only. I believe there is a feature request for option to consolidate on current sessions, or respect rc file settings for consolidation of history, but this isn't an option yet.

FrenchBen commented 3 weeks ago

@dannyneira I noticed a few warp_ shell functions. Would a reload shell script be the right place to do this (aka launch warp_hist or similar)? How would I go about creating a feature design discussion? Can you point me to the code that loads / consolidates history on new session?

dannyneira commented 3 weeks ago

Not sure of which code exactly does this, but starting a new session will consolidate the history as far as I'm aware you can't workaround or disable this behavior

tzaffi commented 1 week ago

Does anyone have a workaround? For me this is borderline blocking me from using Warp.