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

Disable history for the current session #2376

Closed
zx8 opened this issue Sep 10, 2015 · 4 comments
Closed

Disable history for the current session #2376

zx8 opened this issue Sep 10, 2015 · 4 comments

Comments

@zx8
Copy link

zx8 commented Sep 10, 2015

I realise that preceding a command with one or more space characters causes it to not be written to history, but I was wondering if there was a way to temporarily disable history for an entire session? From time to time, I need to repeatedly enter sensitive data (e.g customers' passwords) and it's cumbersome to constantly hit space before each command.

In bash, I'd simply just unset HISTFILE -- how would I do this in fish, if it's at all possible?

@zanchey
Copy link
Member

zanchey commented Sep 11, 2015

It's not possible easily (you can do some magic with fish_prompt by adding commandline " " to the prompt) - see #1156. I'm going to close as a duplicate of that for now.

@zanchey zanchey closed this as completed Sep 11, 2015
@Qix-
Copy link

Qix- commented Dec 17, 2018

Since this is the first issue I could find in google, functionality was implemented (if you follow the chain of linked issues):

According to the docs, it's the following:

set -x fish_histfile ""

Note that case matters. If this doesn't work (and you know you're on an older version of Fish) try FISH_HISTFILE as that's what it was when it was first implemented.

@ghost
Copy link

ghost commented Jun 28, 2019

For the googlers: #102 (comment)

The above comment is no longer correct.

Use fish --private.

@myrdd
Copy link

myrdd commented Jun 30, 2019

Use fish --private.

available since fish v3.0.
documented here: https://fishshell.com/docs/current/#private-mode

not documented in the manpage yet. (https://github.com/fish-shell/fish-shell/blob/master/sphinx_doc_src/cmds/fish.rst)

faho added a commit that referenced this issue Jun 30, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants