| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
In `.editor` mode, `repl.write()` would have crashed when the `key` argument was not present, because the overwritten `_ttyWrite` of REPLs doesn’t check for the absence of a second argument like `readline.write()` does. Since the docs indicate that the argument is optional, add a check paralleling the one in `readline.write()`.
Sorry, something went wrong.
There was a problem hiding this comment.
@addaleax quoted terminal code is sufficient right?
const terminalCodeRegex = /\u001b\[1G\u001b\[0J> \u001b\[3G/g
Sorry, something went wrong.
There was a problem hiding this comment.
@princejwesley Yeah, I’ve updated it to use a regex… I’m not particularly a fan of duplicating strings that are hard to scan, but if you prefer a plain regex literal over what I’ve just pushed, I can go with that too
Sorry, something went wrong.
There was a problem hiding this comment.
@addaleax 👍 Just to convey the term 'quoted' correctly, added code snippet with [ escaped manually 😄
Sorry, something went wrong.
There was a problem hiding this comment.
@princejwesley ok, seems like we’re on the same page then 😄
Sorry, something went wrong.
Instead of writing to the REPL’s input stream for the alignment spaces in `.editor` mode, let `readline` handle the spaces properly (echoing them using `_ttyWrite` and adding them to the current line buffer). Fixes: nodejs#9189
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Sorry, something went wrong.
In `.editor` mode, `repl.write()` would have crashed when the `key` argument was not present, because the overwritten `_ttyWrite` of REPLs doesn’t check for the absence of a second argument like `readline.write()` does. Since the docs indicate that the argument is optional, add a check paralleling the one in `readline.write()`. PR-URL: #9207 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Instead of writing to the REPL’s input stream for the alignment spaces in `.editor` mode, let `readline` handle the spaces properly (echoing them using `_ttyWrite` and adding them to the current line buffer). Fixes: #9189 PR-URL: #9207 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
In `.editor` mode, `repl.write()` would have crashed when the `key` argument was not present, because the overwritten `_ttyWrite` of REPLs doesn’t check for the absence of a second argument like `readline.write()` does. Since the docs indicate that the argument is optional, add a check paralleling the one in `readline.write()`. PR-URL: #9207 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Instead of writing to the REPL’s input stream for the alignment spaces in `.editor` mode, let `readline` handle the spaces properly (echoing them using `_ttyWrite` and adding them to the current line buffer). Fixes: #9189 PR-URL: #9207 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
In `.editor` mode, `repl.write()` would have crashed when the `key` argument was not present, because the overwritten `_ttyWrite` of REPLs doesn’t check for the absence of a second argument like `readline.write()` does. Since the docs indicate that the argument is optional, add a check paralleling the one in `readline.write()`. PR-URL: #9207 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Instead of writing to the REPL’s input stream for the alignment spaces in `.editor` mode, let `readline` handle the spaces properly (echoing them using `_ttyWrite` and adding them to the current line buffer). Fixes: #9189 PR-URL: #9207 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
repl
Description of change
Since the docs indicate that the argument is optional, add a check paralleling the one in readline.write().
spaces in .editor mode, let readline handle the spaces
properly (echoing them using _ttyWrite and adding them to the
current line buffer).
Fixes: #9189