18

In GNU nano 7.2 (the latest as of this posting, as far as I know), why does Ctrl+Delete delete entire words but not Ctrl+Backspace? How do we restore its correct functionality?

top 8 comments
sorted by: hot top new old
[-] tal@lemmy.today 5 points 5 hours ago* (last edited 5 hours ago)

I have GNU nano 8.4 on my system. Upon investigation, in default configuration:

  • Control-Backspace deletes the last character, same as Backspace.

  • Control-Delete reverse-deletes a word.

  • Alt-Backspace deletes the last word. This might be what you want.

  • Alt-Delete deletes the entire line.

I think that it's probably because absent some kind of unusual extension, terminals normally send 0x08, the Backspace character, same as Control-H, for Control-Backspace.

On my system, in bash, using foot, Control-V Control-H shows ^H. So it's sending ASCII 0x8, the Backspace character.

Control-V Control-Backspace shows ^H. Ditto.

Control-V Backspace shows ^?. It's sending the Delete character, ASCII 0x7f.

Control-V Del shows ^[[3~. It's sending an escape sequence.

Back in the day, some people had their terminals set to, when you hit Backspace, send either the Backspace character or the Delete character. Not a problem I've run into for some years, but I'd guess that nano probably has that behavior by default, treating both 0x7f and 0x8 as hitting the Backspace key, so as not to break on systems like that.

EDIT: I'd also add that Alt-Backspace (well, M-DEL in emacs parlance) is also what emacs uses for "delete word", so a lot of software that uses readline, like bash, will also normally work that way out of box.

EDIT2: If you want to investigate ways to have terminals recognize more key combinations (so that you aren't sending the same sequence for both Control-H and Control-Backspace and want to get down and dirty aiming to configure software to use different bindings for those different keystrokes), IIRC the kitty virtual terminal emulator has been exploring extensions, and some terminal emulators have implemented some of those extensions.

searches

Yeah.

https://terminfo.dev/extensions/kitty-keyboard-protocol

The Kitty keyboard protocol solves fundamental ambiguities in traditional terminal input handling. Legacy terminals cannot distinguish between Ctrl+I and Tab, Ctrl+M and Enter, or Escape and the start of an escape sequence — they all produce the same byte sequences. The protocol also enables key-release events and distinguishes between different modifier key presses (left vs. right Shift). Applications opt in with CSI > flags u, where flags is a bitmask selecting reporting modes: disambiguate keys (1), report event types (2), report alternate keys (4), report all keys as escape sequences (8), and report associated text (16). Keys are reported as CSI unicode-key-code : shifted-key : base-layout-key ; modifiers : event-type u. Adopted by Ghostty, WezTerm, foot, and rio. The protocol is progressive — applications can request only the features they need, and terminals report which flags they support.

That being said, I would guess that a lot of programs that run in the terminal won't be set up out of box to rely on Kitty protocol extensions.

EDIT3: Also, I don't think that fbcon (the default Linux kernel framebuffer console) or fbterm (the userspace virtual terminal), one of which you'd probably use if you switched out of Wayland/X11, presently support Kitty input extensions, so if you rig up programs to rely on said extensions, you won't have those keys available in the plain ol' Linux console.

[-] HiTekRedNek@lemmy.world 10 points 11 hours ago

stares in signature look of vim superiority

[-] Thwompthwomp@lemmy.world 6 points 10 hours ago

waits 3 minutes to read this comment condescendingly in emacs with some really sweet customizations

[-] Steamymoomilk@sh.itjust.works 5 points 10 hours ago

wants to reply to comment but doesnt remember the custom key combo

[-] Novocirab@feddit.org 3 points 9 hours ago

shakes head about this blatant lack of basic competency:wq!

[-] Strider@lemmy.world 1 points 47 minutes ago

Arrives late bimut) but smirks..

:x

[-] jahtnamas@slrpnk.net 4 points 12 hours ago

is that not something you can change the bind of in your .nanorc?

[-] Novocirab@feddit.org 1 points 12 hours ago* (last edited 12 hours ago)

The latest version is 9.0, no? https://en.wikipedia.org/wiki/GNU_nano

That's also the version I got on my system. But the behavior is the same as you describe: Ctrl+Backspace doesn't delete words

this post was submitted on 18 May 2026
18 points (90.9% liked)

Linux

17529 readers
80 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS