-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
Unable to disable REPL history on Windows #25661
Copy link
Copy link
Closed
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
lib/internal/repl.js)Per the REPL documentation the history file path can be changed by setting the
NODE_REPL_HISTORYenvironment variable to a valid path or disabled by setting it to the empty string.On Windows platforms an empty environment variable is difficult to set. From my own testing:
sysdm.cpl).''or""will set it to a literal two single quotes or double quotes when using the System Properties UI.''will set it to a literal two single quotes when using thesetxCommand Prompt utility.I've found that a blank variable can be set using
setxwith two double quotes:setx NODE_REPL_HISTORY "". I haven't tried calling the underlying Win32 SetEnvironmentVariable function directly but given the behaviour ofsetxit presumably would work.It seems clear to me that setting blank environment variables is discouraged and the support for doing so is patchy at best. This being the case, it would be desirable to support an alternate value that's legal on Windows to indicate that the REPL history should not be saved. One possible option would be recognising the value
''(i.e. two single quotes) which in my view is the most intuitive setting, but there's of course other options.Thoughts?