From ba6446bd6ca6ae2b95258d28f54da5bdfbe8daf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= Date: Wed, 27 Nov 2024 09:43:42 +0100 Subject: [PATCH] kernel: Run prim_tty on_load handler manually standard_error is started before the on_load handlers in init are run, so prim_tty will not be completely loaded when running in embedded mode. So we call it during init of prim_tty instead. --- lib/kernel/src/prim_tty.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kernel/src/prim_tty.erl b/lib/kernel/src/prim_tty.erl index 022276e8eec3..49dc5d306831 100644 --- a/lib/kernel/src/prim_tty.erl +++ b/lib/kernel/src/prim_tty.erl @@ -128,8 +128,6 @@ %% proc_lib exports -export([reader/1, writer/1]). --on_load(on_load/0). - %%-define(debug, true). -ifdef(debug). -define(dbg(Term), dbg(Term)). @@ -252,6 +250,8 @@ window_size(State = #state{ tty = TTY }) -> -spec init(options()) -> state(). init(UserOptions) when is_map(UserOptions) -> + on_load(), + Options = options(UserOptions), {ok, TTY} = tty_create(maps:get(ofd, Options)),