mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 17:28:48 +00:00
TTY: Don't flush input on every character
Oops, we had a little mistake here. We were flushing whenever !NOFLSH, not just when generating a signal. This broke arrow keys in the terminal (you would only get A/B/C/D when pressing arrow keys, instead of the full escape sequence.)
This commit is contained in:
parent
f9d679ae37
commit
05252cfd3a
Notes:
sideshowbarker
2024-07-19 11:28:48 +09:00
Author: https://github.com/awesomekling
Commit: 05252cfd3a
1 changed files with 2 additions and 3 deletions
|
@ -109,9 +109,6 @@ bool TTY::is_werase(u8 ch) const
|
||||||
void TTY::emit(u8 ch)
|
void TTY::emit(u8 ch)
|
||||||
{
|
{
|
||||||
if (should_generate_signals()) {
|
if (should_generate_signals()) {
|
||||||
if (should_flush_on_signal())
|
|
||||||
flush_input();
|
|
||||||
|
|
||||||
if (ch == m_termios.c_cc[VINTR]) {
|
if (ch == m_termios.c_cc[VINTR]) {
|
||||||
dbg() << tty_name() << ": VINTR pressed!";
|
dbg() << tty_name() << ": VINTR pressed!";
|
||||||
generate_signal(SIGINT);
|
generate_signal(SIGINT);
|
||||||
|
@ -208,6 +205,8 @@ void TTY::generate_signal(int signal)
|
||||||
{
|
{
|
||||||
if (!pgid())
|
if (!pgid())
|
||||||
return;
|
return;
|
||||||
|
if (should_flush_on_signal())
|
||||||
|
flush_input();
|
||||||
dbg() << tty_name() << ": Send signal " << signal << " to everyone in pgrp " << pgid();
|
dbg() << tty_name() << ": Send signal " << signal << " to everyone in pgrp " << pgid();
|
||||||
InterruptDisabler disabler; // FIXME: Iterate over a set of process handles instead?
|
InterruptDisabler disabler; // FIXME: Iterate over a set of process handles instead?
|
||||||
Process::for_each_in_pgrp(pgid(), [&](auto& process) {
|
Process::for_each_in_pgrp(pgid(), [&](auto& process) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue