We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 420394a commit 594414dCopy full SHA for 594414d
pythonrc.py
@@ -661,11 +661,13 @@ def process_edit_cmd(self, arg=""):
661
return self.writeline(e)
662
else:
663
# - make a list of all lines in history, commenting any non-blank lines.
664
- history = self.session_history or open(config.HISTFILE)
+ if not (history := self.session_history):
665
+ history = open(config.HISTFILE).readlines()
666
filename = self._mktemp_buffer(
667
f"# {line}" if line.strip() else ""
668
for line in (line.strip("\n") for line in history)
669
)
670
+ line_num_opt = config.LINE_NUM_OPT.format(line_no=len(history))
671
672
# - shell out to the editor
673
rc = os.system(f"{config.EDITOR} {line_num_opt} {filename}")
0 commit comments