How to quit "trunk serve" Rust

589 views Asked by At

I just started using rust for the web and I have run into a problem where once I call trunk serve I do not know how to stop it.

this must sound like the whole unable to quit vim meme...

3

There are 3 answers

0
kmdreko On BEST ANSWER

Use Ctrl+C. Its the standard way to signal a running command-line tool to exit and I don't think trunk serve understands anything else.

0
Nae On

To kill from another terminal:

kill -9 $(pgrep trunk)
0
Ili On

If ctrl+c doesn't work (for some unknown reason the terminal was stuck and it didn't work for me), you can list the process running on port 8080 (or whatever port you are using to run the server)

sudo lsof -i:8080

and then kill the process kill -9 PID

p.s. works on Linux or Mac