Closed michaeleverson closed 1 year ago
Does ctrl-c work? That's what I always do on linux.
I wonder if the strange behavior is related to running the jvm in the background: https://github.com/jacobobryant/platypub/blob/master/task#L38-L39. If needed that could be restructured.
Ctrl-c has the same behaviour. I will play around more with it after work today.
interesting. Could you edit ./task
so the dev
function runs the JVM in the foreground and then see if you get the same behavior from ctrl-d / ctrl-c:
dev () {
echo $PORT > .nrepl-port
BIFF_ENV=dev run
#css --watch
}
No worries.
I did the edit and now ./task dev
can be ctrl+c-ed and relaunched without an error getting in the way (ctrl+d now does nothing, for whatever reason).
OK, that's good to hear. I'll update platypub then to get rid of the background jvm thing. in the mean time you can run ./task dev as it is now, and run ./task css --watch
in a separate terminal to handle css updates.
I'm guessing the ctrl-d thing is due to some difference between jvm and node 🤷. Maybe tailwind watches stdin. just curious, are you normally able to close other Clojure projects with ctrl-d (in which case maybe I've done something abnormal with Biff)?
On Mon, Sep 26, 2022, at 7:49 PM, Michael Everson wrote:
No worries.
I did the edit and now
./task dev
can be ctrl+c-ed and relaunched without an error getting in the way (ctrl+d now does nothing, for whatever reason).— Reply to this email directly, view it on GitHub https://github.com/jacobobryant/platypub/issues/76#issuecomment-1258894993, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4GPWRDNUNF2ICCM6RSJ33WAJODTANCNFSM6AAAAAAQWG5OYQ. You are receiving this because you commented.Message ID: @.***>
I'm used to using ctrl-d to exit other Clojure projects I've worked on, but I admit for those I've been using them within lein, shadow-clj or even the clj tool directly rather than coordinated via a shell script - so there might be something there? (I had one with tailwind.css, but since I added it myself and was lazy, I always just had it monitoring in another tab). I think the shell script is cool though :)
Oh actually now that I think about it, I'm guessing usually lein etc are opening an interactive prompt when you run them? That would explain why ctrl-d causes the program to end, since it's sending an end-of-document signal and the prompt closes when stdin is closed. whereas with Biff I've made it so the only way to interact with the REPL is via your editor, and it doesn't do anything with stdin. It's been so long I had forgotten about that :).
Yes, I think you're probably right. It's been a happy accident with the ctrl-d business :)
I figured out how to make the css --watch
command run in the background, and I've just pushed a commit which does so and has the jvm run in the foreground. Can you pull that and check if ctrl-c now closes everything correctly?
I've checked it out and the change seems to have fixed the issue. Much appreciated and I'm glad I flagged it :)
Hi,
Great project.
I might be missing something, but what is the best way to shutdown all the processes cleanly after using ./task dev ?
I'm running Platypub locally on my Mac.
If I use ctrl-d there still seems to be something leftover listening on a port and lock files in the db folder that prevents restarting ./task dev (unless I log out / in of my computer).
I can't seem to find a shutdown function in the Clojure code. I tweaked the refresh function to make a shutdown function, which resolved the lock file issue, but the port issue remained (I still had to ctrl-d in the terminal).
Just wondering if I'm doing something incorrectly, or whether I should dig deeper?