Skip to content

Cannot disable REPL history on Windows by setting NODE_REPL_HISTORY_FILE to blank string #4522

Description

I attempted to set NODE_REPL_HISTORY_FILE to a blank string as a Windows System Environment Variable, but the dialog would not allow me to enter a blank string as a value, so I entered a space figuring that Node.js would probably trim the string before using it.

However, when I ran Node again, it instead created a file named (a blank space) that I cannot delete or move now. Anytime I try to delete the file, Explorer acts like I'm trying to delete my whole user profile.

Activity

  1. ghost changed the title [-]Attempting to NODE_REPL_HISTORY_FILE on Windows caused filesystem corruption[/-] [+]Attempting to disable NODE_REPL_HISTORY_FILE on Windows caused filesystem corruption[/+] on Jan 3, 2016
  2. added
    windowsIssues and PRs related to the Windows platform.
    on Jan 3, 2016
  3. ghost changed the title [-]Attempting to disable NODE_REPL_HISTORY_FILE on Windows caused filesystem corruption[/-] [+]Cannot disable REPL on Windows by setting NODE_REPL_HISTORY_FILE to blank string[/+] on Jan 3, 2016
  4. ghost changed the title [-]Cannot disable REPL on Windows by setting NODE_REPL_HISTORY_FILE to blank string[/-] [+]Cannot disable REPL history on Windows by setting NODE_REPL_HISTORY_FILE to blank string[/+] on Jan 3, 2016
  5. added
    replIssues and PRs related to the REPL subsystem.
    on Jan 4, 2016
  6. evanlucas commented on Jan 4, 2016

    @evanlucas
    Contributor

    Sorry for the trouble you are having. On which version of node are you seeing this issue?

  7. Fishrock123 commented on Jan 4, 2016

    @Fishrock123
    Contributor

    I'll try to look at this tomorrow.

  8. evanlucas commented on Jan 5, 2016

    @evanlucas
    Contributor

    What's weird about this is that we aren't opening process.env.NODE_REPL_HISTORY_FILE anymore. We simply call fs.readFileSync on it. We are now using process.env.NODE_REPL_HISTORY for the file path. I did notice that it is not being trimmed though, so I went ahead and submitted a PR to fix that.

  9. Fishrock123 commented on Jan 7, 2016

    @Fishrock123
    Contributor

    I was able to set the environment variable by opening an Admin command prompt and running:

    SETX NODE_REPL_HISTORY_FILE "" /M
    

    When I checked the Windows System Environment Variable dialog, I could see it there as well.

    However, Node.js still creates a history file in my user profile when I open a new command prompt and run the REPL.

    @waynebloss What's process.env say when you do this?

  10. Fishrock123 commented on Jan 7, 2016

    @Fishrock123
    Contributor

    @waynebloss So the issue here is seeing an "empty" ENV variable on windows? That could be an issue in libuv or something.

  11. MylesBorins commented on Jan 28, 2016

    @MylesBorins
    Contributor

    @waynebloss are you still having this problem? it may have been fixed in v5.5.0

  12. MylesBorins commented on Jan 28, 2016

    @MylesBorins
    Contributor

    @waynebloss the commit in question has been backported to the staging branch for LTS. You should likely see it land in LTS in the next 2 weeks

  13. evanlucas commented on Mar 8, 2016

    @evanlucas
    Contributor

    Closing as this was released in v4.3.1. Thanks for reporting @waynebloss! Please let us know if you have any more issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions