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

fish_history negates private mode #7590

Closed
etcusrvar opened this issue Dec 31, 2020 · 1 comment
Closed

fish_history negates private mode #7590

etcusrvar opened this issue Dec 31, 2020 · 1 comment
Milestone

Comments

@etcusrvar
Copy link

etcusrvar commented Dec 31, 2020

fish 3.1.2
Linux 5.9.16 x86_64

According to the docs - "In private mode, old history is not available and any interactive commands you execute will not be appended to the global history file"

But when launching fish with both fish_history set and in private mode, private mode is ignored/overridden/negated.

$ d=$(mktemp -d)
$ cd $d
$ sh -c "env HOME=$d fish"
Welcome to fish, ...
x@x ~> foo
fish: Unknown command: foo
x@x ~ [127]> bar
fish: Unknown command: bar
x@x ~ [127]> history
bar
foo
x@x ~> exit

$ sh -c "env HOME=$d fish --private"
Welcome to fish, ...
fish is running in private mode, history will not be persisted.
x@x ~> history
x@x ~> exit

$ sh -c "env HOME=$d fish_history=default fish --private"
Welcome to fish, ...
fish is running in private mode, history will not be persisted.
x@x ~> history
history
bar
foo
x@x ~> baz
fish: Unknown command: baz
x@x ~ [127]> history
baz
history
bar
foo
x@x ~> exit

$ sh -c "env HOME=$d fish"
Welcome to fish, ...
x@x ~> history
baz
history
bar
foo
@ridiculousfish
Copy link
Member

With 118f710, fish_private_mode and fish_history are distinct. If fish_private_mode is set, commands you run are stored in memory, and can be recalled via up-arrow, but are not written to disk. It can be dynamically toggled on and off by setting the fish_private_mode variable.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants