Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
2593-fixup-stdlib-shell-pager.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2593-fixup-stdlib-shell-pager.patch of Package erlang
From 2ac9bb9736f0d180f3e99666628a3d4651989259 Mon Sep 17 00:00:00 2001 From: frazze-jobb <frazze@erlang.org> Date: Fri, 8 Dec 2023 11:50:36 +0100 Subject: [PATCH 3/4] fixup! stdlib: shell pager --- lib/kernel/src/group.erl | 4 ++-- lib/kernel/src/prim_tty.erl | 4 ---- lib/kernel/src/user_drv.erl | 3 --- lib/ssh/src/ssh_cli.erl | 4 ++-- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/kernel/src/group.erl b/lib/kernel/src/group.erl index 9d7c263bb6..930bf99b6c 100644 --- a/lib/kernel/src/group.erl +++ b/lib/kernel/src/group.erl @@ -687,7 +687,7 @@ get_line1({Expand, Before, Cs0, Cont,Rs}, Drv, Shell, Ls0, Encoding) end, case get(expand_below) of true -> - send_drv(Drv, {put_expand, unicode, NlMatchStr, NLines}), + send_drv(Drv, {put_expand, unicode, unicode:characters_to_binary(string:trim(MatchStr, trailing)), NLines}), Cs1; false -> send_drv(Drv, {put_chars, unicode, NlMatchStr}), @@ -773,7 +773,7 @@ get_line1({What,{line,Prompt,{_,{RevCmd0,_},_},{search, none}}=Cont0,Rs}, put(search_result, Lines), send_drv(Drv, delete_line), send_drv(Drv, {insert_chars, unicode, unicode:characters_to_binary(Prompt++Cmd)}), - send_drv(Drv, {put_expand_no_trim, unicode, unicode:characters_to_binary(Line), 7}), + send_drv(Drv, {put_expand, unicode, unicode:characters_to_binary(" "++lists:join("\n ",Lines)), 7}), {Ls2, {[],{RevCmd, []},[]}} end, Cont = {line,Prompt,NewStack,{search, none}}, diff --git a/lib/kernel/src/prim_tty.erl b/lib/kernel/src/prim_tty.erl index 460161752d..9d0eb4bd68 100644 --- a/lib/kernel/src/prim_tty.erl +++ b/lib/kernel/src/prim_tty.erl @@ -173,7 +173,6 @@ {putc_raw, binary()} | {putc, unicode:unicode_binary()} | {expand, unicode:unicode_binary(), integer()} | - {expand_with_trim, unicode:unicode_binary(), integer()} | {insert, unicode:unicode_binary()} | {insert_over, unicode:unicode_binary()} | {delete, integer()} | @@ -709,9 +708,6 @@ handle_request(State, new_prompt) -> %% Print characters in the expandbuffer after the cursor handle_request(State, {expand, Expand, N}) -> handle_request(State#state{buffer_expand = Expand, buffer_expand_limit = N}, redraw_prompt); -handle_request(State, {expand_with_trim, Binary, N}) -> - handle_request(State, - {expand, iolist_to_binary([string:trim(Binary, both)]), N}); %% putc prints Binary and overwrites any existing characters handle_request(State = #state{ redraw_prompt_on_output = RedrawOnOutput, unicode = U }, {putc, Binary}) -> diff --git a/lib/kernel/src/user_drv.erl b/lib/kernel/src/user_drv.erl index 777e0be2f8..0e48e3f5db 100644 --- a/lib/kernel/src/user_drv.erl +++ b/lib/kernel/src/user_drv.erl @@ -53,7 +53,6 @@ {put_chars_sync, unicode, binary(), {From :: pid(), Reply :: term()}} | %% Put text in expansion area {put_expand, unicode, binary(), integer()} | - {put_expand_no_trim, unicode, binary(), integer()} | {move_expand, -32768..32767} | %% Move the cursor X characters left or right (negative is left) {move_rel, -32768..32767} | @@ -791,8 +790,6 @@ io_request({put_chars_sync, unicode, Chars, Reply}, TTY) -> {ok, MonitorRef} = prim_tty:write(NewTTY, Output, self()), {Reply, MonitorRef, NewTTY}; io_request({put_expand, unicode, Chars, N}, TTY) -> - write(prim_tty:handle_request(TTY, {expand_with_trim, unicode:characters_to_binary(Chars), N})); -io_request({put_expand_no_trim, unicode, Chars, N}, TTY) -> write(prim_tty:handle_request(TTY, {expand, unicode:characters_to_binary(Chars), N})); io_request({move_expand, N}, TTY) -> write(prim_tty:handle_request(TTY, {move_expand, N})); diff --git a/lib/ssh/src/ssh_cli.erl b/lib/ssh/src/ssh_cli.erl index f3027b083a..fbcec8e8c1 100644 --- a/lib/ssh/src/ssh_cli.erl +++ b/lib/ssh/src/ssh_cli.erl @@ -431,8 +431,8 @@ io_request({put_chars, Cs}, Buf, Tty, _Group) -> put_chars(bin_to_list(Cs), Buf, Tty); io_request({put_chars, unicode, Cs}, Buf, Tty, _Group) -> put_chars(unicode:characters_to_list(Cs,unicode), Buf, Tty); -io_request({put_expand_no_trim, unicode, Expand}, Buf, Tty, _Group) -> - insert_chars(unicode:characters_to_list(Expand, unicode), Buf, Tty); +io_request({put_expand, unicode, Expand, _N}, Buf, Tty, _Group) -> + insert_chars(unicode:characters_to_list("\n"++Expand, unicode), Buf, Tty); io_request({insert_chars, Cs}, Buf, Tty, _Group) -> insert_chars(bin_to_list(Cs), Buf, Tty); io_request({insert_chars, unicode, Cs}, Buf, Tty, _Group) -> -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor