Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exitting problems #21

Open
MatthewWest opened this issue Apr 21, 2015 · 10 comments
Open

Exitting problems #21

MatthewWest opened this issue Apr 21, 2015 · 10 comments

Comments

@MatthewWest
Copy link

Not sure if here or pixie is the correct place for this. Two issues:

  1. Exiting using Ctrl-D doesn't actually exit, but just prints out a new prompt
  2. 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.
@heyLu
Copy link
Member

heyLu commented Apr 22, 2015

  1. It works for me on Linux. Does it work in pixie-vm? (More things to try: does it work without rlwrap? Does Ctrl-C work?)
  2. I've submitted Exit the repl when the form is just :exit pixie#298 for that. When it gets merged, the expression :exit will close the repl.

@MatthewWest
Copy link
Author

@heyLu

  1. 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.

@MatthewWest
Copy link
Author

@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.

@heyLu
Copy link
Member

heyLu commented Apr 23, 2015

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.

@MatthewWest
Copy link
Author

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 [email protected] 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).

@daveyarwood
Copy link

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?

@heyLu
Copy link
Member

heyLu commented Oct 9, 2015

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.

@daveyarwood
Copy link

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.

@thomasmulvaney
Copy link
Member

Should we remove rlwrap now that we have build in history?

@heyLu
Copy link
Member

heyLu commented Oct 10, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants