Skip to content

Commit 23f7e47

Browse files
committed
repl: use unicode chars for new lines
1 parent 8f52797 commit 23f7e47

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

doc/api/repl.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ changes:
663663
Added support for multi-line history.
664664
It is now possible to "fix" multi-line commands with syntax errors
665665
by visiting the history and editing the command.
666+
When visiting the multiline history from an old node version,
667+
the multiline structure is not preserved.
666668
- version:
667669
- v13.4.0
668670
- v12.17.0

lib/internal/repl/history.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function setupHistory(repl, historyPath, ready) {
9797
}
9898

9999
if (data) {
100-
repl.history = RegExpPrototypeSymbolSplit(/\n+/, data, repl.historySize);
100+
repl.history = RegExpPrototypeSymbolSplit(/\r?\n+/, data, repl.historySize);
101101
} else {
102102
repl.history = [];
103103
}

0 commit comments

Comments
 (0)