Can't unset `SHARE_HISTORY` option

Open
#1,994 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
zsh
Domain
cli

Research direction

Start by reproducing the behavior with the reported .zshrc, .zprofile, and .zshenv settings, comparing a fresh Warp restart with sourcing ~/.zshrc. Trace how Warp launches zsh and applies history options; done means SHARE_HISTORY can be unset during startup and new .zsh_history entries no longer contain timestamps.

Written by the indexing model from the issue text.

Description

area:search bug needs-info ready-to-implement triaged
Discord username (optional)

JanJakes#1807

Describe the bug

I was tuning up ZSH history settings and at some point I had setopt SHARE_HISTORY in my .zshrc file. That option happens to include command timestamps (same as EXTENDED_HISTORY does).

Before doing that, my .zsh_history records were looking as follows, for instance: ls -la
After that, they look like this: : 1666343798:0;ls -la

The problem is, I can't revert these settings in any way. What I tried:

  1. Removing all of the options form .zshrc.
  2. Adding setopt NO_SHARE_HISTORY and unsetopt SHARE_HISTORY in this and inverse order to .zshrc.
  3. Adding setopt NO_EXTENDED_HISTORY to .zshrc.
  4. Adding setopt INC_APPEND_HISTORY to .zshrc.
  5. Restarting the app after all of the above attempts.
  6. Disabling session restoration and restarting the app after all of the above attempts.
  7. Restarting the computer.
  8. Uninstalling Warp (all the files via Raycast but I kept ~/.warp) and doing a fresh install.
  9. Adding all of the above options to .zprofile and .zshenv files.

The thing is, .zshrc is loaded (adding some echo outputs stuff) but none of the unsetopts take effect. When I do source ~/.zshrc, then it works (with unsetopt SHARE_HISTORY).

Using setopt INC_APPEND_HISTORY in .zshrc doesn't work either, while doing source ~/.zshrc helps.

So I can see two parts to this problem:

  1. Once I had setopt SHARE_HISTORY in my .zshrc, it's somehow persisted forever and it's always applied, even when removed, restarted, reinstalled, etc.
  2. The options that can override this are not applied in .zshrc, they work only on subsequent source ~/.zshrc.
To Reproduce
  1. Run a command (e.g., ls -la) and check that your .zsh_history doesn't contain timestamps (such as : 1666343798:0;ls -la).
  2. Add setopt SHARE_HISTORY to your .zshrc, restart Warp.
  3. Run a command (e.g., ls -la) and see that your .zsh_history does contain timestamps (such as : 1666343798:0;ls -la) — this is expected.
  4. Remove setopt SHARE_HISTORY from your .zshrc, restart Warp.
  5. Run a command (e.g., ls -la) and see that your .zsh_history still contains timestamps (such as : 1666343798:0;ls -la) — this is probably not expected.
  6. Add unsetopt SHARE_HISTORY and/or setopt NO_SHARE_HISTORY to .zshrc, restart Warp.
  7. Run a command (e.g., ls -la) and see that your .zsh_history still contains timestamps (such as : 1666343798:0;ls -la) — this is probably not expected.
Expected behaviour

At step 5. of the above reproduction, there should be no timestamps in .zsh_history. Same goes for point 7.

Screenshots

No response

Operating System

MacOS

OS Version

12.6

Shell Version

zsh 5.8.1 (x86_64-apple-darwin21.0)

Warp Version

v0.2022.10.11.08.13.stable_01

Additional context

No response

Does this block you from using Warp daily?

No

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

No response

Dominant language
Rust
Stars
65.1k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from warpdotdev/warp

All issues in warpdotdev/warp

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.