Exitting problems
MatthewWest opened this issue · 10 comments
Not sure if here or pixie is the correct place for this. Two issues:
- Exiting using Ctrl-D doesn't actually exit, but just prints out a new prompt
- The exit function should at least be multivalent to default to exit status of 0, even better would be if dust recognized the keyword "exit" and just exited when it saw that, without having to call the pixie (exit 0) function.
- It works for me on Linux. Does it work in
pixie-vm
? (More things to try: does it work withoutrlwrap
? DoesCtrl-C
work?) - I've submitted pixie-lang/pixie#298 for that. When it gets merged, the expression
:exit
will close the repl.
- It does work in pixie-vm, not in dust.
2. I think it'd be preferable to have exit the symbol be recognized, rather than the keyword. The reason is that keywords are generally not reserved, and since they can be used as a function (at least in clojure) into a map, it isn't a good idea to make evaluating a special keyword exit. Rather, we could provide a special check in dust whether a line is only "exit". It isn't necessary to do in pixie itself, I don't think.
Edit: I read the pull request and changed my mind about point 2.
@heyLu I just checked with rlwrap pixie-vm
, and it has the same problem as dust with not exiting on Ctrl-D, so this appears to be an issue with rlwrap. However, if I do rlwrap bash
I can close it with Ctrl-D, so the problem appears to be in the intersection of rlwrap and pixie-vm.
dust
actually invokes rlwrap -aignored -n pixie-vm
, can you try that with bash
and pixie-vm
? It may also be Mac OS X specific, as it works on my machine, which runs Linux.
I tried it on both pixie-vm
and bash
, and it has the same issues. The interesting thing is that bash explicitly says exit
when I enter Ctrl-D, as if I had typed that command. Maybe the problem can be addressed in pixie-vm’s main loop, looking for Ctrl-D in a different way? I’ll take a look at what’s currently going on.
On Apr 23, 2015, at 2:09 PM, Lucas Stadler notifications@github.com wrote:
dust actually invokes rlwrap -aignored -n pixie-vm, can you try that with bash and pixie-vm? It may also be Mac OS X specific, as it works on my machine, which runs Linux.
—
Reply to this email directly or view it on GitHub #21 (comment).
I can reproduce the same problem on my Macbook. Pressing Ctrl-D doesn't exit, it shows the prompt again on the same line, e.g. (pressing ^D a few times)
user => user => user => user =>
Running rlwrap dust
doesn't help.
Interestingly, pixie-vm
exits with Ctrl-D out of the box, no need for rlwrap
, and I have command history available to me. Has rlwrap
been rolled into Pixie since this issue was created?
I still don't know what the problem is, and I have no mac to try and fix it.
Since pixie-lang/pixie#379 Pixie's repl has history support built-in.
I forgot to mention, Ctrl-C does close the Dust REPL for me. So, it's not really a show-stopper as far as I can tell. It must be something to do with the way that the ^D signal is sent for Linux vs. OS X.
Should we remove rlwrap
now that we have build in history?
I don't think so, at least not yet. The built-in history is not persistent across runs of pixie-vm
, but the one in rlwrap
is. In addition, rlwrap
has some support for paren-matching, which I find quite helpful.