Skip to content

Instantly share code, notes, and snippets.

@andscoop
Created February 17, 2018 14:10
Show Gist options
  • Save andscoop/874ff042a28ca5aaa06426a58aacaf83 to your computer and use it in GitHub Desktop.
Save andscoop/874ff042a28ca5aaa06426a58aacaf83 to your computer and use it in GitHub Desktop.
fix nice-editor (ne) backspace issue
KEY 0x7f BS
KEY 0x115 DC
@craigbarnes
Copy link

craigbarnes commented Oct 21, 2019

For a key as fundamental as backspace, I can't understand how so many terminfo files can be so wrong, nor why it seems impossible to get them fixed.

Yeah, it's unfortunate that it's ended up that way, but I can understand how it happened. No terminal developer wants to wait until every distro picks up their custom terminfo entry, so they just abuse the xterm one. There are countless other problems caused by this, but fortunately text editors don't typically run into them.

... what would have to happen to get the backspace key definition fixed in some significant portion of the terminfo definitions where it's currently broken?

Probably for every terminal emulator that claims to be xterm to start using the same key code. Or at least the ones people still use.

I can imagine a simple interactive program that asks you to press different keys and it tells you where your terminfo is right/wrong

The xterm/ncurses maintainer has something like that at https://invisible-island.net/ncurses/tack.html.

I don't know if that would help, though, because you'd have to get someone to run it who's in a position to do something about the problems it might turn up.

I'm at the stage where I just assume that anything not part of the basic common subset of features will be completely messed up by at least one terminal. Unfortunately, people actually use such terminals -- so the best thing you can do is stay within that small set of features and just take a pragmatic approach to things like the backspace issue.

@ortonomy
Copy link

@andscoop -- you wonderfuk bastard. this has been annoying the hell out of me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment