Measure the width of text in the terminal and build simple layouts!
0

Configure Feed

Select the types of activity you want to include in your feed.

update tui_ffi platform with the things we've learned

+4 -4
+4 -4
test/tui_ffi.erl
··· 15 15 %% 16 16 %% To be able to exit properly on CTRL+C, you have to invoke erlang with the +Bc flag: 17 17 %% 18 - %% erl -pa ./build/dev/erlang/string_width/ebin -pa ./build/dev/erlang/gleam_stdlib/ebin -pa ./build/dev/erlang/gleeunit/ebin -pa build/dev/erlang/filepath/ebin/ -pa build/dev/erlang/simplifile/ebin/ +Bc -noshell -s human_rights main -s init stop 18 + %% ERL_FLAGS="+Bc" gleam run -m human_rights 19 19 %% 20 20 %% Just `gleam run` also works, but will bring up the break handler menu on CTRL+C. 21 21 %% If you abort, your terminal will still be somewhat broken; a `reset` fixes that. ··· 42 42 loop(State, OnResize, OnData, View) -> 43 43 %% io:put_chars(<<"\e[0;0H"/utf8>>), 44 44 io:put_chars(string:replace(View(State), <<"\n"/utf8>>, <<"\r\n"/utf8>>, all)), 45 + %% io:put_chars(unicode:characters_to_binary(integer_to_list(os:system_time()))), 45 46 receive 46 47 { data, Chars } -> 47 48 case handle_input(Chars, State, OnData) of ··· 61 62 end. 62 63 63 64 handle_input(<<>>, State, _OnData) -> State; 64 - %% handle_input(<<3, _rest/bits>>, _State, _OnData) -> stop; 65 + handle_input(<<3, _rest/bits>>, _State, _OnData) -> stop; 65 66 handle_input(<<"q"/utf8, _rest/bits>>, _State, _OnData) -> stop; 66 67 handle_input(Rest, State, OnData) -> OnData(State, Rest). 67 68 ··· 86 87 handle_call(_Request, State) -> 87 88 {ok, ok, State}. 88 89 89 - terminate(_Args, {Pid} = State) -> 90 - Pid ! { signal, sigint }, 90 + terminate(_Args, _State) -> 91 91 ok.