|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi, all,
In my profile, "erase" is set to "set erase '^h'" which is working for most of times. But, sometime, I use xterm to create a new terminal and the backspace key is set to "^?" instead for unknown some reasons, my platform is Redhead Linux, not sure why it happens and how to prevent it happening. thx. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
At 2007-07-17 04:53PM, "wenmang" wrote:
> Hi, all, > > In my profile, "erase" is set to "set erase '^h'" which is working for Don't you want: stty erase ^H -- Glenn Jackman "You can only be young once. But you can always be immature." -- Dave Barry |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Tue, 17 Jul 2007 13:53:18 -0700, wenmang
<wenmang@yahoo.com> wrote: > > > Hi, all, > > In my profile, "erase" is set to "set erase '^h'" which is working for > most of times. But, sometime, I use xterm to create a new terminal and > the backspace key is set to "^?" instead for unknown some reasons, my > platform is Redhead Linux, not sure why it happens and how to prevent > it happening. thx. > case "$TERM" in *xterm*) stty erase '^?' ;; "") ;; *) stty erase '^h' ;; esac -- Most people want either less corruption or more of a chance to participate in it. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Tue, 17 Jul 2007 13:53:18 -0700, wenmang
<wenmang@yahoo.com> wrote: > > > Hi, all, > > In my profile, "erase" is set to "set erase '^h'" which is working for > most of times. But, sometime, I use xterm to create a new terminal and > the backspace key is set to "^?" instead for unknown some reasons, my > platform is Redhead Linux, not sure why it happens and how to prevent > it happening. thx. > case "$TERM" in *xterm*) stty erase '^?' ;; "") ;; *) stty erase '^h' ;; esac -- Most people want either less corruption or more of a chance to participate in it. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Jul 18, 9:04 am, Bill Marcum <marcumb...@bellsouth.net> wrote:
> On Tue, 17 Jul 2007 13:53:18 -0700, wenmang <wenm...@yahoo.com> wrote: > > > Hi, all, > > > In my profile, "erase" is set to "set erase '^h'" which is working for > > most of times. But, sometime, I use xterm to create a new terminal and > > the backspace key is set to "^?" instead for unknown some reasons, my > > platform is Redhead Linux, not sure why it happens and how to prevent > > it happening. thx. > > case "$TERM" in > *xterm*) stty erase '^?' ;; > "") ;; > *) stty erase '^h' ;; > esac > > -- > Most people want either less corruption or more of a chance to > participate in it. All my terminals are xterms, but sometime the backspace binding is changed during launching the new xterm. Do we have the way to preset the backspace key to prevent it changing in a script? |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Jul 20, 8:37 am, wenmang <wenm...@yahoo.com> wrote:
> On Jul 18, 9:04 am, Bill Marcum <marcumb...@bellsouth.net> wrote: > > All my terminals are xterms, but sometime the backspace binding is > changed during launching the new xterm. Do we have the way to preset > the backspace key to prevent it changing in a script? Maybe sometimes it starts with "xterm -ls" or maybe sometimes with "xterm +ls". I'm not sure if that would cause your problem though. |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
2007-07-17, 13:53(-07), wenmang:
[...] > In my profile, "erase" is set to "set erase '^h'" which is working for > most of times. But, sometime, I use xterm to create a new terminal and > the backspace key is set to "^?" instead for unknown some reasons, my > platform is Redhead Linux, not sure why it happens and how to prevent > it happening. thx. On Linux, ^? is the default erase character for the (pseudo-)terminal driver, so xterm is right to issue that character when you press Backspace. That's rather your other terminal emulator that is behaving strangly. If you use ^H, that means that you also need to tune your terminal driver so that it considers ^H and not ^? as the erase character. Now you can configure xterm to issue ^H as well if you want. This can be done via resources. See xterm's man page for details. -- Stéphane |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
2007-07-20, 06:37(-07), wenmang:
[...] >> case "$TERM" in >> *xterm*) stty erase '^?' ;; >> "") ;; >> *) stty erase '^h' ;; >> esac >> [...] > All my terminals are xterms, but sometime the backspace binding is > changed during launching the new xterm. Do we have the way to preset > the backspace key to prevent it changing in a script? That's rather strange maybe something is installing resources in the X server. What does xrdb -q | grep -ie delete -e backspace -e erase give you How are your xterms started? Are some TERMINFO, TERMCAP variables defined by some of your login scripts. I think by default xterm will look up its own terminfo entry (for the kbs entry) to determine what character to send upon <Backspace>. Does: echo "$TERM" output the same in all your xterms? what about tput kbs | od -b ? What I would recommand you do is have all your terminal applications output ^? upon <Backspace> as it's Linux's terminal driver default, make sure all the terminfo entry are consistent with that. And make sure there's no "stty erase" in any of your startup scripts (think of the ones in /etc as well). -- Stéphane |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
2007-07-23, 09:32(+00), Stephane CHAZELAS:
> 2007-07-20, 06:37(-07), wenmang: > [...] >>> case "$TERM" in >>> *xterm*) stty erase '^?' ;; >>> "") ;; >>> *) stty erase '^h' ;; >>> esac >>> > [...] >> All my terminals are xterms, but sometime the backspace binding is >> changed during launching the new xterm. Do we have the way to preset >> the backspace key to prevent it changing in a script? > > That's rather strange maybe something is installing resources in > the X server. [...] Or are you using screen by any chance? Or something changing the DECBKM (DEC back arrow mode) in one of your startup scripts. printf '\033[?67h' Should set the DECBKM state to use ^H. Another thing to consider is working with other systems that have different defaults and different terminfo entries. Applications like telnet can do the translation on the fly but they are rarely properly configured to do so. What you need to know is that you can configure about everything. You can query xterm for which character it sends with an escape sequence (can be done with the tset command), and configure its default by X resources or dynamically using tset again or control sequences. You can query the terminfo database (a database describing to visual applications the behavior of terminals) using the tput and infocmp commands. You can configure it with the TERMINFO variable and the -- Stéphane |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
> printf '\033[?67h' Above line works now, thanks a lot. |
|
![]() |
| Outils de la discussion | |
|
|