zsh-workers
 help / color / mirror / code / Atom feed
* zsh in screen - bad erase key ^@ instead of ^H or ^?
@ 2007-12-18  7:09 Chuck
  2007-12-18 10:29 ` Peter Stephenson
  2007-12-18 15:01 ` Wayne Davison
  0 siblings, 2 replies; 10+ messages in thread
From: Chuck @ 2007-12-18  7:09 UTC (permalink / raw)
  To: zsh-workers

How do I tell zsh in screen that my backspace key is ^H or ^? instead of
^@ as it currently thinks? stty erase '^@' fails as does using tset.
^v(bs key) tells me bs is currently ^@. zsh works great outside of
screen just not quite right inside it. Version is 4.3.2 gentoo stable build.
Any pointers would be greatly appreciated.
Thanks!


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: zsh in screen - bad erase key ^@ instead of ^H or ^?
  2007-12-18  7:09 zsh in screen - bad erase key ^@ instead of ^H or ^? Chuck
@ 2007-12-18 10:29 ` Peter Stephenson
  2007-12-18 18:16   ` Chuck
  2007-12-18 15:01 ` Wayne Davison
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Stephenson @ 2007-12-18 10:29 UTC (permalink / raw)
  To: Chuck, zsh-workers

On Mon, 17 Dec 2007 23:09:55 -0800
Chuck <GBSCDcM8oX5F7qrd@spambox.us> wrote:
> How do I tell zsh in screen that my backspace key is ^H or ^? instead of
> ^@ as it currently thinks? stty erase '^@' fails as does using tset.

It may be you're doing the opposite of what you need...

> ^v(bs key) tells me bs is currently ^@.

...this indicates the backspace key currently *is* sending ^@, because
the ^V stops zsh interpreting the character.

So instead, try making it so that it sends ^H or ^?: "stty erase '^?'".
(This is likely to be some artefact of screen since zsh doesn't
change special characters of that sort.)

If for some reason you're stuck with the backspace key sending ^@, you
can use "bindkey" to tell zsh to use it for functions usually bound with ^?
and ^h, but you shouldn't need to do that.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: zsh in screen - bad erase key ^@ instead of ^H or ^?
  2007-12-18  7:09 zsh in screen - bad erase key ^@ instead of ^H or ^? Chuck
  2007-12-18 10:29 ` Peter Stephenson
@ 2007-12-18 15:01 ` Wayne Davison
  2007-12-18 18:19   ` Chuck (vid,smtp3)
  1 sibling, 1 reply; 10+ messages in thread
From: Wayne Davison @ 2007-12-18 15:01 UTC (permalink / raw)
  To: Chuck; +Cc: zsh-workers

On Mon, Dec 17, 2007 at 11:09:55PM -0800, Chuck wrote:
> ^v(bs key) tells me bs is currently ^@.

Check your screenrc files to see if the backspace key is being handled
specially.  I've seen the following in /etc/screenrc on some older systems:

bindkey -d -k kb stuff ^H

Perhaps yours has ^@?  You can override this by leaving off the "stuff"
command:

bindkey -d -k kb

..wayne..


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: zsh in screen - bad erase key ^@ instead of ^H or ^?
  2007-12-18 10:29 ` Peter Stephenson
@ 2007-12-18 18:16   ` Chuck
  2007-12-18 18:27     ` Peter Stephenson
  0 siblings, 1 reply; 10+ messages in thread
From: Chuck @ 2007-12-18 18:16 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers



Peter Stephenson wrote:
> On Mon, 17 Dec 2007 23:09:55 -0800
> Chuck <GBSCDcM8oX5F7qrd@spambox.us> wrote:
>   
>> How do I tell zsh in screen that my backspace key is ^H or ^? instead of
>> ^@ as it currently thinks? stty erase '^@' fails as does using tset.
>>     
>
> It may be you're doing the opposite of what you need...
>
>   
>> ^v(bs key) tells me bs is currently ^@.
>>     
>
> ...this indicates the backspace key currently *is* sending ^@, because
> the ^V stops zsh interpreting the character.
>
> So instead, try making it so that it sends ^H or ^?: "stty erase '^?'".
> (This is likely to be some artefact of screen since zsh doesn't
> change special characters of that sort.)
>   
Unfortunately, bs really is sending ^@ in screen and I cannot change it.
stty erase '^H' or '^?' doesn't change bs at all. It's as if the key
mapping at a lower level is screwed up.
> If for some reason you're stuck with the backspace key sending ^@, you
> can use "bindkey" to tell zsh to use it for functions usually bound with ^?
> and ^h, but you shouldn't need to do that.
>   
I added a bindkey "^@" "backward-delete-char" in my zshrc when TERM =
screen and I can hit bs and it works in zsh proper. If I run vim though,
my editor of choice, the bs key just throws me out of edit mode instead
of deleting the previous char.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: zsh in screen - bad erase key ^@ instead of ^H or ^?
  2007-12-18 15:01 ` Wayne Davison
@ 2007-12-18 18:19   ` Chuck (vid,smtp3)
  0 siblings, 0 replies; 10+ messages in thread
From: Chuck (vid,smtp3) @ 2007-12-18 18:19 UTC (permalink / raw)
  To: Wayne Davison; +Cc: zsh-workers

Nope, no bindkeys like that. I tried to force

bindkey -d -k kb stuff ^H

but it didn't have any affect.

Wayne Davison wrote:
> On Mon, Dec 17, 2007 at 11:09:55PM -0800, Chuck wrote:
>   
>> ^v(bs key) tells me bs is currently ^@.
>>     
>
> Check your screenrc files to see if the backspace key is being handled
> specially.  I've seen the following in /etc/screenrc on some older systems:
>
> bindkey -d -k kb stuff ^H
>
> Perhaps yours has ^@?  You can override this by leaving off the "stuff"
> command:
>
> bindkey -d -k kb
>
> ..wayne..
>
>   


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: zsh in screen - bad erase key ^@ instead of ^H or ^?
  2007-12-18 18:16   ` Chuck
@ 2007-12-18 18:27     ` Peter Stephenson
  2007-12-18 19:51       ` Chuck (vid,smtp3)
  2007-12-18 20:26       ` Chuck
  0 siblings, 2 replies; 10+ messages in thread
From: Peter Stephenson @ 2007-12-18 18:27 UTC (permalink / raw)
  To: Chuck; +Cc: zsh-workers

Chuck wrote:
> Unfortunately, bs really is sending ^@ in screen and I cannot change it.

If that's the case, then bindkey in zsh is your only hope.

> stty erase '^H' or '^?' doesn't change bs at all. It's as if the key
> mapping at a lower level is screwed up.

zsh does have the capability to freeze the terminal settings:  make sure
you have "ttyctl -u" in effect.  "ttyctl" on its own will tell you what
the current state is.  If it reports "tty is not frozen" I think you've
run out of things you can do in the shell.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: zsh in screen - bad erase key ^@ instead of ^H or ^?
  2007-12-18 18:27     ` Peter Stephenson
@ 2007-12-18 19:51       ` Chuck (vid,smtp3)
  2007-12-18 20:26       ` Chuck
  1 sibling, 0 replies; 10+ messages in thread
From: Chuck (vid,smtp3) @ 2007-12-18 19:51 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers



Peter Stephenson wrote:
> Chuck wrote:
>   
>> Unfortunately, bs really is sending ^@ in screen and I cannot change it.
>>     
>
> If that's the case, then bindkey in zsh is your only hope.
>
>   
>> stty erase '^H' or '^?' doesn't change bs at all. It's as if the key
>> mapping at a lower level is screwed up.
>>     
>
> zsh does have the capability to freeze the terminal settings:  make sure
> you have "ttyctl -u" in effect.  "ttyctl" on its own will tell you what
> the current state is.  If it reports "tty is not frozen" I think you've
> run out of things you can do in the shell.
>   
It reports that the tty is not frozen. :(


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: zsh in screen - bad erase key ^@ instead of ^H or ^?
  2007-12-18 18:27     ` Peter Stephenson
  2007-12-18 19:51       ` Chuck (vid,smtp3)
@ 2007-12-18 20:26       ` Chuck
  2007-12-19  0:44         ` Vincent Lefevre
  1 sibling, 1 reply; 10+ messages in thread
From: Chuck @ 2007-12-18 20:26 UTC (permalink / raw)
  To: zsh-workers

Ok, I just did a ^K BS and it output <Nul> instead of <BS>. I can get
around this in vim by mapping <Nul> to <BS> but there's problems sshing
or using any program that uses bs. Anyone know how to change my
backspace key codes? I'm pretty sure that's the problem.  stty erase
blah doesnt seem to work, and I cant force a ttyctl f before running the
screen...
Thanks!



Peter Stephenson wrote:
> Chuck wrote:
>   
>> Unfortunately, bs really is sending ^@ in screen and I cannot change it.
>>     
>
> If that's the case, then bindkey in zsh is your only hope.
>
>   
>> stty erase '^H' or '^?' doesn't change bs at all. It's as if the key
>> mapping at a lower level is screwed up.
>>     
>
> zsh does have the capability to freeze the terminal settings:  make sure
> you have "ttyctl -u" in effect.  "ttyctl" on its own will tell you what
> the current state is.  If it reports "tty is not frozen" I think you've
> run out of things you can do in the shell.
>
>   


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: zsh in screen - bad erase key ^@ instead of ^H or ^?
  2007-12-18 20:26       ` Chuck
@ 2007-12-19  0:44         ` Vincent Lefevre
  2007-12-19  8:14           ` Chuck
  0 siblings, 1 reply; 10+ messages in thread
From: Vincent Lefevre @ 2007-12-19  0:44 UTC (permalink / raw)
  To: zsh-workers

On 2007-12-18 12:26:47 -0800, Chuck wrote:
> Ok, I just did a ^K BS and it output <Nul> instead of <BS>. I can get
> around this in vim by mapping <Nul> to <BS> but there's problems sshing
> or using any program that uses bs. Anyone know how to change my
> backspace key codes? I'm pretty sure that's the problem.  stty erase
> blah doesnt seem to work, and I cant force a ttyctl f before running the
> screen...

You have a problem with your "screen" utility. FYI, a search for

  screen backspace nul

on Google gives:

  https://bugs.launchpad.net/ubuntu/+source/screen/+bug/29787

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: zsh in screen - bad erase key ^@ instead of ^H or ^?
  2007-12-19  0:44         ` Vincent Lefevre
@ 2007-12-19  8:14           ` Chuck
  0 siblings, 0 replies; 10+ messages in thread
From: Chuck @ 2007-12-19  8:14 UTC (permalink / raw)
  To: zsh-workers

Awesome!! That was my problem! Thanks so much
 -Chuck

Vincent Lefevre wrote:
> On 2007-12-18 12:26:47 -0800, Chuck wrote:
>   
>> Ok, I just did a ^K BS and it output <Nul> instead of <BS>. I can get
>> around this in vim by mapping <Nul> to <BS> but there's problems sshing
>> or using any program that uses bs. Anyone know how to change my
>> backspace key codes? I'm pretty sure that's the problem.  stty erase
>> blah doesnt seem to work, and I cant force a ttyctl f before running the
>> screen...
>>     
>
> You have a problem with your "screen" utility. FYI, a search for
>
>   screen backspace nul
>
> on Google gives:
>
>   https://bugs.launchpad.net/ubuntu/+source/screen/+bug/29787
>
>   


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-12-19  8:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-18  7:09 zsh in screen - bad erase key ^@ instead of ^H or ^? Chuck
2007-12-18 10:29 ` Peter Stephenson
2007-12-18 18:16   ` Chuck
2007-12-18 18:27     ` Peter Stephenson
2007-12-18 19:51       ` Chuck (vid,smtp3)
2007-12-18 20:26       ` Chuck
2007-12-19  0:44         ` Vincent Lefevre
2007-12-19  8:14           ` Chuck
2007-12-18 15:01 ` Wayne Davison
2007-12-18 18:19   ` Chuck (vid,smtp3)

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).