about delete character with Backspace!

28 views
Skip to first unread message

Hy Od

unread,
Jan 6, 2019, 10:44:49 AM1/6/19
to niceeditor
hi all,

i try to package ne for guix: a package manager
and when i run it i cant delete the last character whith Backspace
is it normal?

todd_...@unc.edu

unread,
Jan 6, 2019, 9:33:47 PM1/6/19
to niceeditor


On Sunday, January 6, 2019 at 10:44:49 AM UTC-5, Hy Od wrote:
hi all,

i try to package ne for guix: a package manager
and when i run it i cant delete the last character [with] Backspace
is it normal?
 
That is most definitely not normal. Two thoughts come to mind.

First thought: your cursor would need to be past the last character so that the BackSpace would delete it. Is your cursor on or beyond the last character? (Let me elaborate a bit. There are two types of cursors: insertion bars and block cursors. Insertion bars typically fit between characters, while block cursors typically invert the colors of a displayed character. The latter case is rather like an insertion bar at the left edge of the block. Does that make sense? To remove the last character with the BackSpace key, you'd need the block to display one character position beyond -- i.e. to the right of -- the last character.)

Second thought: is there some screen artifact left over from some previous displayed text? Ctrl-L should refresh the whole window. If that works, then there's something messed up about the terminal definition. At least, that's my best guess.

If neither of those apply, perhaps you can step us through the minimum keystrokes needed to reproduce the phenomenon you described...

And thanks for building ne for guix. I'm not familiar with it, so I've got some reading to do. :)
--
Todd

Guy fleury

unread,
Jan 7, 2019, 4:19:19 AM1/7/19
to nicee...@googlegroups.com
Le lun. 7 janv. 2019 à 03:33, <todd_...@unc.edu> a écrit :


On Sunday, January 6, 2019 at 10:44:49 AM UTC-5, Hy Od wrote:
hi all,

i try to package ne for guix: a package manager
and when i run it i cant delete the last character [with] Backspace
is it normal?
 
That is most definitely not normal. Two thoughts come to mind.

First thought: your cursor would need to be past the last character so that the BackSpace would delete it. Is your cursor on or beyond the last character?
 
i wanted to talk the left character of cursor. Backspace and Delete work the same!
if the curson is on character it delete the character like Del

(Let me elaborate a bit. There are two types of cursors: insertion bars and block cursors. Insertion bars typically fit between characters, while block cursors typically invert the colors of a displayed character. The latter case is rather like an insertion bar at the left edge of the block. Does that make sense? To remove the last character with the BackSpace key, you'd need the block to display one character position beyond -- i.e. to the right of -- the last character.)

 sorry i am don't undastand where (my english skill is little).

Second thought: is there some screen artifact left over from some previous displayed text? Ctrl-L should refresh the whole window. If that works, then there's something messed up about the terminal definition. At least, that's my best guess.

If neither of those apply, perhaps you can step us through the minimum keystrokes needed to reproduce the phenomenon you described...

And thanks for building ne for guix. I'm not familiar with it, so I've got some reading to do. :)

i give someone to test it to see that it reproduce the same phenomenon! 
--
Todd

--
You received this message because you are subscribed to the Google Groups "niceeditor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to niceeditor+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

todd_...@unc.edu

unread,
Jan 7, 2019, 9:36:01 AM1/7/19
to niceeditor


On Monday, January 7, 2019 at 4:19:19 AM UTC-5, Hy Od wrote:


Le lun. 7 janv. 2019 à 03:33, <todd_...@unc.edu> a écrit :

i wanted to talk the left character of cursor. Backspace and Delete work the same!
if the curson is on character it delete the character like Del

Okay, now I understand. This is a classic case of "BackSpace vs. Del" and what keys produce what codes and/or escape sequences. There have been many pages written, arguments had, etc. about this topic. Most editors -- fortunately or unfortunately, depending on how you feel about such things -- take the easy way out and just do what seems to work, even when terminal definitions are clearly wrong. The downside of this is that broken terminal definitions never get fixed because everything just seems to work anyway so why bother.

For better or worse, ne takes a rather strict interpretation of the terminfo terminal definitions, and if Backspace and Delete aren't right, then neither will be your terminal's behavior.

Try this for the Backspace:
   Hit Ctrl-K  (which should bring up ne's command line)
   Enter "keycode" and hit Enter. It should prompt "Press a key to see ne's corresponding key code:"
   Hit your Backspace key. It should respond with something like "Key Code: 0x112,  Input Class: COMMAND,  Assigned Command: BS"
Now do the same thing for your Del key:
   Hit Ctrl-K
   Enter "keycode" (or "kc" for short) and hit Enter.
   Hit your Del key. It should respond similar to "Key Code: 0x115,  Input Class: COMMAND,  Assigned Command: DC"

My guess is both key codes will be assigned the same command, probably "DC" (i.e. short for DeleteChar). If that's the case, but the Key Codes are different, you can probably fix them by creating or editing your ~/.ne/.keys file like so:

# Fix BackSpace
KEY 112 BS
# Fix Del
KEY 115 DC

Note I used the same Key Codes the KeyCode command displayed for those keys. You may have different values.

Of course, the real answer is to get your distribution to fix their broken termcap/terminfo definitions for your terminal, but I don't hold out much hope for that. You can use "infocmp -L xterm" for example to dump out the terminfo definition for xterm.
 
 sorry i am don't undastand where (my english skill is little).

Your English skill is much better than my French (and everything else for that matter). I would much rather know about a problem than miss one because of language issue. So, thanks for being willing to ask.
 
i give someone to test it to see that it reproduce the same phenomenon!

That's always a good idea too. We appreciate your efforts to make ne better. 
--
Todd

Guy fleury

unread,
Jan 7, 2019, 12:07:02 PM1/7/19
to nicee...@googlegroups.com
Le lun. 7 janv. 2019 à 15:36, <todd_...@unc.edu> a écrit :


On Monday, January 7, 2019 at 4:19:19 AM UTC-5, Hy Od wrote:


Le lun. 7 janv. 2019 à 03:33, <todd_...@unc.edu> a écrit :

i wanted to talk the left character of cursor. Backspace and Delete work the same!
if the curson is on character it delete the character like Del

Okay, now I understand. This is a classic case of "BackSpace vs. Del" and what keys produce what codes and/or escape sequences. There have been many pages written, arguments had, etc. about this topic. Most editors -- fortunately or unfortunately, depending on how you feel about such things -- take the easy way out and just do what seems to work, even when terminal definitions are clearly wrong. The downside of this is that broken terminal definitions never get fixed because everything just seems to work anyway so why bother.

For better or worse, ne takes a rather strict interpretation of the terminfo terminal definitions, and if Backspace and Delete aren't right, then neither will be your terminal's behavior.

Try this for the Backspace:
   Hit Ctrl-K  (which should bring up ne's command line)
   Enter "keycode" and hit Enter. It should prompt "Press a key to see ne's corresponding key code:"
   Hit your Backspace key. It should respond with something like "Key Code: 0x112,  Input Class: COMMAND,  Assigned Command: BS"
Now do the same thing for your Del key:
   Hit Ctrl-K
   Enter "keycode" (or "kc" for short) and hit Enter.
   Hit your Del key. It should respond similar to "Key Code: 0x115,  Input Class: COMMAND,  Assigned Command: DC"

My guess is both key codes will be assigned the same command, probably "DC" (i.e. short for DeleteChar). If that's the case, but the Key Codes are different, you can probably fix them by creating or editing your ~/.ne/.keys file like so:

# Fix BackSpace
KEY 112 BS
# Fix Del
KEY 115 DC

thanks that was the issue.
my present problem is that ne don't load .ne/keys i don't know whats wrong!
to fix the first i force with:
   ne  --keys filename
but it's not friendly to  do that every time.

Note I used the same Key Codes the KeyCode command displayed for those keys. You may have different values.

Of course, the real answer is to get your distribution to fix their broken termcap/terminfo definitions for your terminal, but I don't hold out much hope for that. You can use "infocmp -L xterm" for example to dump out the terminfo definition for xterm.
 
 sorry i am don't undastand where (my english skill is little).

Your English skill is much better than my French (and everything else for that matter). I would much rather know about a problem than miss one because of language issue. So, thanks for being willing to ask.
 
i give someone to test it to see that it reproduce the same phenomenon!

That's always a good idea too. We appreciate your efforts to make ne better. 
--
Todd

--

todd_...@unc.edu

unread,
Jan 7, 2019, 1:46:48 PM1/7/19
to niceeditor


On Monday, January 7, 2019 at 12:07:02 PM UTC-5, Hy Od wrote:

My guess is both key codes will be assigned the same command, probably "DC" (i.e. short for DeleteChar). If that's the case, but the Key Codes are different, you can probably fix them by creating or editing your ~/.ne/.keys file like so:

# Fix BackSpace
KEY 112 BS
# Fix Del
KEY 115 DC

thanks that was the issue.
my present problem is that ne don't load .ne/keys i don't know whats wrong!
to fix the first i force with:
   ne  --keys filename
but it's not friendly to  do that every time.

The problem is you've misspelled ".ne/.keys" as ".ne/keys". There's a "." before "keys".

Guy fleury

unread,
Jan 7, 2019, 2:53:28 PM1/7/19
to nicee...@googlegroups.com
thanks,

i submit the patch to upstream.
i will notice you if the patch is applied.

--
Reply all
Reply to author
Forward
0 new messages