Backspace problems under FreeBSD

Emacs seems to have a problem with BACKSPACE, at least in my installation. Do other programs also generate C-h when hitting BACKSPACE and is there a generally accepted solution since I've come across several.
 
Emacs seems to have a problem with BACKSPACE
What's the problem? The fact that it generates a C-h? Which starts the Emacs help system instead of deleting a character?
Do other programs also generate C-h when hitting BACKSPACE?
Yes, because C-h generates an ASCII control character with a value of decimal 8 called BS (BACKSPACE). However, Emacs overrides this by using C-h as a keybinding to access the help system using the letter 'h' as a mnemonic for help. To return the BACKSPACE key to it's original functionality of deleting characters rather than starting the help system follow one of the instructions in the following link.
Is there a generally accepted solution?
Well, that depends on what you want to happen. In Emacs My BACKSPACE key performs a DEL operation and C-h brings up the help system, which works for me. I'm using vanilla Emacs and don't seem to have changed this setting explicitly, so I'm assuming that it's the default. If you're using Doom Emacs then you may need to set or override a setting somewhere.
 
Emacs seems to have a problem with BACKSPACE, at least in my installation. Do other programs also generate C-h when hitting BACKSPACE and is there a generally accepted solution since I've come across several.

Are you talking about Emacs in a terminal (curses) or Emacs' own X11 mode?
 
I think using Ctrl-H (also known as ^H) to anything other than BS is abuse.
I suspect balanga is talking about the [backspace] key on the right of the [+] key.

What does "stty all" report for erase? If you want ^?, try "stty erase ^?". If you want ^H, try "stty ^H". Put whichever you want in your .zlogin (if running zsh, equivalent in other shells).
 
Yes I'm talking about the key on the right of the [+] key.

But I'm no really sure what you are suggesting.

root@W520:~ $ stty all
speed 9600 baud; 64 rows; 266 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
brkint -inpck -ignpar -parmrk iutf8
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf rtsdtr
discard dsusp eof eol eol2 erase erase2 intr kill
^O ^Y ^D <undef> <undef> ^? ^H ^C ^U
lnext min quit reprint start status stop susp time
^V 1 ^\ ^R ^Q ^T ^S ^Z 0
werase
^W

Do mean something in ~/.profile?


Do I need to make this change in my ~/.shrc and have no idea what it's for

# Fix home/del for mobaxterm
bind ^[[5~ ed-move-to-beg
bind ^[[6~ ed-move-to-end


Other solutions I have come across talk about making changes within emacs's configuration files or within .Xresources.
 
I see that you have erase (backspace) key set to ^? (ctrl-?). Add this in your ~/.profile "stty erase ^H" so that the next time you login it will be set to ^H. For your current shell run "stty erase ^H". I don't use emacs so can't help with it.
 
I suspect balanga is talking about the [backspace] key on the right of the [+] key.

What does "stty all" report for erase? If you want ^?, try "stty erase ^?". If you want ^H, try "stty ^H". Put whichever you want in your .zlogin (if running zsh, equivalent in other shells).

root@W520:~ # stty all
speed 9600 baud; 63 rows; 265 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
brkint -inpck -ignpar -parmrk iutf8
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf rtsdtr
discard dsusp eof eol eol2 erase erase2 intr kill
^O ^Y ^D <undef> <undef> ^? ^H ^C ^U
lnext min quit reprint start status stop susp time
^V 1 ^\ ^R ^Q ^T ^S ^Z 0
werase
^W



This is just too confusing for me.

In other places I'm told

"\e[3~": delete-char
"\C-h": backward-delete-char

I guess 'backward delete char' refers to the backspace key.

In emacs C-h brings up the help screen.

 
What's the problem? The fact that it generates a C-h? Which starts the Emacs help system instead of deleting a character?

Yes, because C-h generates an ASCII control character with a value of decimal 8 called BS (BACKSPACE). However, Emacs overrides this by using C-h as a keybinding to access the help system using the letter 'h' as a mnemonic for help. To return the BACKSPACE key to it's original functionality of deleting characters rather than starting the help system follow one of the instructions in the following link.

Well, that depends on what you want to happen. In Emacs My BACKSPACE key performs a DEL operation and C-h brings up the help system, which works for me. I'm using vanilla Emacs and don't seem to have changed this setting explicitly, so I'm assuming that it's the default. If you're using Doom Emacs then you may need to set or override a setting somewhere.
I have a DELETE key which perfoms a DEL operation.

I want the BACKSPACE key to move the cursor one space to the left and delete the character under the cursor the same way it works in virtually every other program.
 
I want the BACKSPACE key to move the cursor one space to the left and delete the character under the cursor the same way it works in virtually every other program.
~/.emacs.d/init.el
Code:
(when window-system
  (load-library "term/bobcat")
  (terminal-init-bobcat))
 
I want the BACKSPACE key to move the cursor one space to the left and delete the character under the cursor
Try adding (normal-erase-is-backspace-mode 1) to your init.el file and then restart Emacs. Doing this means that you may lose the ability to use the C-h key sequence to bring up the Emacs help system. If so, you can always rebind the help system to another key sequence like C-x h instead.
 
Try adding (normal-erase-is-backspace-mode 1) to your init.el file and then restart Emacs. Doing this means that you may lose the ability to use the C-h key sequence to bring up the Emacs help system. If so, you can always rebind the help system to another key sequence like C-x h instead.
What this does is simply move the cursor one space to the left. It does not delete the character that was under the cursor.
 
It worked for me. Please take a look at this page which hopefully explains it more clearly. Don't forget that you're also running Doom Emacs and not vanilla Emacs like I am. That may have some bearing on whether it works or not.
 
It worked for me. Please take a look at this page which hopefully explains it more clearly. Don't forget that you're also running Doom Emacs and not vanilla Emacs like I am. That may have some bearing on whether it works or not.
page is wrong!

Every keyboard has a large key, usually labeled BACKSPACE

All my computers have Delete key, and often just beneath it is what most people refer to as a Backspace key which is not labelled as such but has an X inside a container.

I have found difference between pressing this key in Xterm and in LXTerminal. In Xterm it invokes C-h, in LXTerminal it moves the cursor one space to the left but does not delete anything.

In regular emacs I get C-h under Xterm but it works as I want under LXTerminal.

Also I'm running emacs from tmux in an Xterm so that may have some bearing.

In any case this is driving me nuts.
 
All my computers have Delete key, and often just beneath it is what most people refer to as a Backspace key which is not labelled as such but has an X inside a container.
The backspace is typically at the top right hand corner of the "main" section of a keyboard, above the <Enter> key (but you might have a backslash/pipe key in between; depends on a horizontal or vertical <enter> key).

The <DEL> key is typically in a block of 6 keys above the cursor keys.
<INS> <HOME> <Pg UP>
<DEL> <END> <Pg Down>

The <DEL> key usually deletes the character the cursor is on and moves the entire rest of the line one position to the left (cursor position doesn't move and stays at the same place).
The <BACKSPACE> key deletes the character on the left of the cursor position, moves the cursor position and the rest of the line one position to the left.
 
Yes, I was just point out that the page referenced above says there is a key labelled BACKSPACE which I have never seen , but they seem to be referring to the key labelled Delete.

It seems that what I need to do in Emacs is to assign the function delete-backward-char to this char - DEL (?)
 
Code:
My ThinkPad W520 just hangs when I turn it on after displaying the initial screen.
Same with my ThinkPad X61,
W520 and X61 have Backspace.
S7c513eae9ff44209ad5aafe658e08f6a7.jpg_640x640q75.jpg_.avif

S69763e3713bc43d6a7a900b0a129e589D.jpg_640x640q75.jpg_.avif
 
Back
Top