Bug#452922: bash: Some key sequences, such as \C-@, do not work in a key binding

2012-01-06 Thread Jonathan Nieder
Hi,

Javier Barroso wrote:

 When I try bind '\C-@: complete-hostname', it works fine

 But, ALT-f works like ESC-f (forward-word)

In other words, you ran into a completely different bug.  You might
find [1], [2], and [3] interesting.

Josh, are you still able to reproduce the trouble binding \C-@ and
\C-v with expansions including \C-@ in readline or bash?

Thanks and sorry for the trouble,
Jonathan

[1] http://bugs.debian.org/326200
[2] http://bugs.debian.org/574396
[3] http://bugs.debian.org/651035



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#452922: bash: Some key sequences, such as \C-@, do not work in a key binding

2012-01-06 Thread Javier Barroso
Hi,

On Fri, Jan 6, 2012 at 5:17 PM, Jonathan Nieder jrnie...@gmail.com wrote:

 Hi,

 Javier Barroso wrote:

  When I try bind '\C-@: complete-hostname', it works fine
 
  But, ALT-f works like ESC-f (forward-word)

 In other words, you ran into a completely different bug.  You might
 find [1], [2], and [3] interesting.

 Josh, are you still able to reproduce the trouble binding \C-@ and
 \C-v with expansions including \C-@ in readline or bash?

 Thanks and sorry for the trouble,
 Jonathan

 [1] http://bugs.debian.org/326200
 [2] http://bugs.debian.org/574396
 [3] http://bugs.debian.org/651035

First, thank you very much

All that links seems to talk about X issues.

But in my case it fail both with Xorg and without Xorg (in tty1,tty2 ..)

I don't know if I should open a new issue, I choose this bug because the
title Some key sequences, such as XX, do not work ...

It is courious:

With ALT key:
\e# works
\e@ doesn't works

Both # and @ has to be produced by ALT-GR  (+3 or 2) in my keyboard,
so ALT and ALT-GR are being recognized ok.

Regards,


Bug#452922: bash: Some key sequences, such as \C-@, do not work in a key binding

2012-01-06 Thread Jonathan Nieder
retitle 452922 bash: \C-@ does not work in a key binding; some key sequences 
require the longer Control-$key syntax
quit

Javier Barroso wrote:

 All that links seems to talk about X issues.

Are you sure?  http://bugs.debian.org/326200#135 seems to be
discussing the Linux console driver.

[...]
 I don't know if I should open a new issue, I choose this bug because the
 title Some key sequences, such as XX, do not work ...

Yes, please do open a new bug describing your set of symptoms in full.

You can see what character sequence each keystroke produces by preceding
the keystroke with control+v, if you want to track down whether the bug
is in the console driver that produces the character sequences or
bash which recognizes them.

Thanks and hope that helps,
Jonathan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#452922: bash: Some key sequences, such as \C-@, do not work in a key binding

2012-01-06 Thread Javier Barroso
Sorry, I reply too fast ...

On Fri, Jan 6, 2012 at 5:57 PM, Javier Barroso javibarr...@gmail.comwrote:

 Hi,

 On Fri, Jan 6, 2012 at 5:17 PM, Jonathan Nieder jrnie...@gmail.comwrote:

 Hi,

 Javier Barroso wrote:

  When I try bind '\C-@: complete-hostname', it works fine
 
  But, ALT-f works like ESC-f (forward-word)

 In other words, you ran into a completely different bug.  You might
 find [1], [2], and [3] interesting.

 Josh, are you still able to reproduce the trouble binding \C-@ and
 \C-v with expansions including \C-@ in readline or bash?

 Thanks and sorry for the trouble,
 Jonathan

 [1] http://bugs.debian.org/326200
 [2] http://bugs.debian.org/574396
 [3] http://bugs.debian.org/651035

 First, thank you very much

 All that links seems to talk about X issues.

 But in my case it fail both with Xorg and without Xorg (in tty1,tty2 ..)

 I don't know if I should open a new issue, I choose this bug because the
 title Some key sequences, such as XX, do not work ...

 It is courious:

 With ALT key:
 \e# works
 \e@ doesn't works

This is true in X terminals (xterm and gnome-terminal)

But without X, neither work (not \e# and not \e@ when I use ALT like  \e).
But ALT-f and ALT-b work. So maybe the ALT-GR key has relation with the
fail. When I use ESC it  (@ and #) works.

Sorry again for the fast reply

Regards,


Bug#452922: bash: Some key sequences, such as \C-@, do not work in a key binding

2007-11-25 Thread Josh Triplett
Package: bash
Version: 3.1dfsg-8
Severity: normal

I wanted to use set-mark as part of a readline key binding.  One
simple example I tried, which should have worked:

bind 'Control-v: [EMAIL PROTECTED]\C-x\C-x'

This should make Control-v insert an  at the end of the line but
leave the cursor in the current position.  However, it does not work.
At first I thought that the set-mark command would not work in a key
binding.  However, I discovered that I could bind another key to
set-mark, and that key would work:

bind '\C-x\C-m: set-mark'
bind 'Control-v: \C-x\C-m\C-e\C-x\C-x'

I furthermore discovered that if I bound some other function or string
to C-@, it would not work in a macro either:

bind '\C-@: at'
bind 'Control-v: \C-@'

Finally, I discovered that some key sequences only work if bound via
the longer Control-$char syntax, and others only work if bound via
\C-$char.  For instance, Control-v only works if bound as Control-v;
if bound as \C-v it will continue to point to quoted-insert (both in
a key binding and interactively).  Control-@, on the other hand, only
works if bound as \C-@; if bound as Control-@, it will continue to
point to set-mark (interactively; it does not work either way in a key
binding).

The eventual goal, which I managed to achieve after these various
workarounds:

# Make Control-v paste, if in X and if xclip available
if [ -n $DISPLAY ]  [ -x /usr/bin/xclip ] ; then
# Work around a bash bug: \C-@ does not work in a key binding
bind '\C-x\C-m: set-mark'
# The '#' characters ensure that kill commands have text to work on; if
# not, this binding would malfunction at the start or end of a line.
bind 'Control-v: #\C-b\C-k#\C-x\C-?\$(xclip -o -selection 
c)\\e\C-e\C-x\C-m\C-a\C-y\C-?\C-e\C-y\ey\C-x\C-x\C-d'
fi

- Josh Triplett

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash depends on:
ii  base-files4.0.2  Debian base system miscellaneous f
ii  debianutils   2.28   Miscellaneous utilities specific t
ii  libc6 2.7-1  GNU C Library: Shared libraries
ii  libncurses5   5.6+20071103-1 Shared libraries for terminal hand

bash recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]