mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
HackStudio: Fix cursor not jumping to column 1 in the embedded terminal
Normally, it's the TTY layer's job to translate '\n' into the separate
'\r' and '\n' control characters needed by the terminal to move the
cursor to the first column of the next line.
(see 5d80debc1f
).
In HackStudio, we directly inject data into the TerminalWidget to
display command status. This means that this automatic translation
doesn't happen, so we need to explicitly give it the '\r' too.
This commit is contained in:
parent
a5548a97f1
commit
21acebd372
Notes:
sideshowbarker
2024-07-17 23:12:14 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/21acebd3727 Pull-request: https://github.com/SerenityOS/serenity/pull/11165 Reviewed-by: https://github.com/ccapitalK ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
|
@ -55,11 +55,11 @@ void TerminalWrapper::run_command(const String& command)
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
if (WIFEXITED(wstatus)) {
|
||||
m_terminal_widget->inject_string(String::formatted("\033[{};1m(Command exited with code {})\033[0m\n", wstatus == 0 ? 32 : 31, WEXITSTATUS(wstatus)));
|
||||
m_terminal_widget->inject_string(String::formatted("\033[{};1m(Command exited with code {})\033[0m\r\n", wstatus == 0 ? 32 : 31, WEXITSTATUS(wstatus)));
|
||||
} else if (WIFSTOPPED(wstatus)) {
|
||||
m_terminal_widget->inject_string("\033[34;1m(Command stopped!)\033[0m\n");
|
||||
m_terminal_widget->inject_string("\033[34;1m(Command stopped!)\033[0m\r\n");
|
||||
} else if (WIFSIGNALED(wstatus)) {
|
||||
m_terminal_widget->inject_string(String::formatted("\033[34;1m(Command signaled with {}!)\033[0m\n", strsignal(WTERMSIG(wstatus))));
|
||||
m_terminal_widget->inject_string(String::formatted("\033[34;1m(Command signaled with {}!)\033[0m\r\n", strsignal(WTERMSIG(wstatus))));
|
||||
}
|
||||
m_pid = -1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue