lib: repl add .load-editor feature#14503
Conversation
Fishrock123
left a comment
There was a problem hiding this comment.
Needs docs.
Should be added under https://github.com/nodejs/node/blob/master/doc/api/repl.md#commands-and-special-keys
lib/repl.js
Outdated
There was a problem hiding this comment.
Maybe 'Load a file and enter editor mode'?
ab13971 to
b217b78
Compare
|
Would you please update your summary to describe your PR? eg.
|
There was a problem hiding this comment.
any reason to have these modification? (a blank line and some spaces)
There was a problem hiding this comment.
because add .load-editor command need more space for fomat
> .help
.break Sometimes you get stuck, this gets you out
.clear Break, and also clear the local context
.editor Enter editor mode
.exit Exit the repl
.help Print this help message
.load Load JS from a file into the REPL session
.load-editor Load a file and enter editor mode
.save Save all evaluated commands in this REPL session to a file
.say1 help for say1
.say2
>
Trott
left a comment
There was a problem hiding this comment.
Thanks for this! It would seem that it needs a test.
There was a problem hiding this comment.
How about this blank line?
97dc9c9 to
6137b22
Compare
|
@Fishrock123 I updated doc |
doc/api/repl.md
Outdated
There was a problem hiding this comment.
It would be helpful to have an example
There was a problem hiding this comment.
Do you mean add an example in doc?
There was a problem hiding this comment.
Yeah. For instance, I presume there's a way of providing the file name to load but that's not captured here
There was a problem hiding this comment.
Just how .load does it should be fine, the second line.
There was a problem hiding this comment.
Thanks, I have updated doc file
There was a problem hiding this comment.
stream.write = common.mustNotCall('writing not allowed');
|
In #14861 (comment) I discovered that |
|
@lance |
|
@robbinhan I see your point. But it seems to me that, as-is, As I said in my PR, I didn't mean to encroach on what you were doing here, I was just trying to address #14022. I wasn't aware of your PR until a comment from @Fishrock123. I definitely appreciate your contribution here, and I am willing to go with whatever approach makes the most sense. In this case, I feel it's fixing |
|
@lance So, does improve |
|
@robbinhan in my opinion, yes. But I want to hear from other @nodejs/collaborators on it. |
|
I'm thinking that the other PR is likely the better option. Not quite ready to sign off on it tho. |
|
I looked at both of these and I am definitely in favor of #14861. As @lance already pointed out it is more like a bug fix instead of adding a new feature. @robbinhan I appreciate your work a lot nevertheless! |
|
Closing due to the already mentioned reasons. |
support input
.load-editorin repl