eraser(9)
π eraser β handle erase function β¨
ok so bestie, welcome to eraser(9) from the Kernel API Manual, section 9 π. this is the little function that handles what happens when someone actually presses the erase key, and honestly? it's doing the most for you behind the scenes. let's get into it π«Ά
β¨ SYNOPSIS β¨
void eraser (u8 c , const struct tty_struct *tty );
πΈ ARGUMENTS πΈ
cβ the character input, aka the actual char coming at you πttyβ the terminal device, the whole vibe of a terminal this is happening on π»
π¦ DESCRIPTION π¦
okay so here's the tea: eraser performs the erase and the necessary output whenever an erase character shows up in the stream coming from the driver layer π₯. it's not just "poof, gone" β no ma'am, there's output involved too.
and the icon behavior? it handles the complexities of UTF-8 multibyte symbols π. like, multibyte characters are genuinely messy and this function is out here dealing with all of it so you don't have to. not me being obsessed with a kernel function π
Locking: n_tty_receive_buf/producer path: caller holds non-exclusive termios_rwsem π
lowkey important: that locking note is not decorative, bestie. on then_tty_receive_buf/producer path the caller is the one holding the non-exclusivetermios_rwsem. you don't grab it yourself, and you definitely don't drop it. periodt π
π SEE ALSO π
the kernel file ./drivers/tty/n_tty.c, plus literally this entire friend group:
n_tty_kick_worker(9), n_tty_write_wakeup(9), put_tty_queue(9), reset_buffer_flags(9), n_tty_flush_buffer(9), is_utf8_continuation(9), is_continuation(9), do_output_char(9), process_output(9), process_output_block(9), __process_echoes(9), add_echo_byte(9), echo_move_back_col(9), echo_set_canon_col(9), echo_erase_tab(9), echo_char_raw(9), echo_char(9), finish_erasing(9), isig(9), n_tty_receive_break(9), n_tty_receive_overrun(9), n_tty_receive_parity_error(9), n_tty_receive_char_flow_ctrl(9), n_tty_receive_char(9), n_tty_receive_buf_common(9), n_tty_set_termios(9), n_tty_close(9), n_tty_open(9), copy_from_read_buf(9), canon_copy_from_read_buf(9), job_control(9), n_tty_read(9), n_tty_write(9), n_tty_poll(9), n_tty_inherit_ops(9) π
like yeah, that's a lot of friends, but they all live in ./drivers/tty together and they're all iconic in their own way β
and that's the whole page, bestie!! πΈπβ¨ this was eraser(9) from ./drivers/tty, dated October 2026 β mwah, go erase something iconic ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms