Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: Run prim_tty on_load handler manually
Browse files Browse the repository at this point in the history
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.
garazdawi committed Nov 27, 2024
1 parent ad8176a commit ba6446b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kernel/src/prim_tty.erl
Original file line number Diff line number Diff line change
@@ -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)),

0 comments on commit ba6446b

Please sign in to comment.