Hermanverschooten

Hermanverschooten

Quitting an iex session - any difference between System.halt/1 & CTRL-C?

Generally when I want to quit an iex session I use the double control-c dance.
For unknown reasons this refused to work earlier today but I am not getting into that.
Because of it though I tried System.halt/1 to exit the session and that worked.

Is there a difference between the 2 methods?

Else I could add something like this to my .iex.exs

defmodule IexExtra do
  def exit, do: System.halt()
end
import IexExtra

Then I can end my sessions with a plain and simple exit

Most Liked

DidactMacros

DidactMacros

If Elixir ever gets a magazine it should be called ctrl-GQ.

I’ll see myself out.

acangiano

acangiano

There are scenarios where CTRL-C twice could take down daemons running on a remote node. Not much harm if you are just messing around locally. However, if we are talking best practices, you’d probably want CTRL-G to bring up the User switch command menu, followed by q. Try h to see the options available.

gregvaughn

gregvaughn

I learned ctrl-g q from an Erlanger early in my Elixir career and taught it to my fingers.

Last Post!

Hermanverschooten

Hermanverschooten

Hah, never knew about that combo, thx

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement