FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 10-21-2011, 12:52 PM
suvayu ali
 
Default Key bindings for screen

Hi everyone,

I have been trying to setup some keybindings for screen but have been
rather unsuccessful so far. The documentation is very difficult to
understand / follow for me. I was wondering if someone could help me
understand how to specify key combinations with modifier keys.

I want to be able to switch terminals with either `escape key
<arrow>' or `escape key C-<arrow>'. I would also like to change
my escape key from C-a to C-q (easier to navigate in bash and
emacs). These are my attempts so far:

1. Switching terminals: I tried the following for `escape key
<arrow>', but it doesn't work.

bindkey -d ^[[D prev
bindkey -d ^[[C next

Then I tried the following for `escape key C-<arrow>'.

bindkey -d ^[[1;5D prev
bindkey -d ^[[1;5C next

This somewhat works. The problem now is, after swithing the terminals
if I press the escape key for a subsequent command it is interpreted
as the concluding part of a C-a C-a sequence and screen switches to
the original terminal. To give you an example a sequence like this,
`C-a C-<left> C-a A' is interpreted as `prev other A' instead of
`prev title'.

2. Changing the escape key: This is more of an issue with the terminal
emulator rather than screen. My terminal emulator (xfce4 terminal)
doesn't pass on the C-q to screen. Strangely when I run emacs in the
terminal (emacs -nw) or I run emacs within screen, C-q is passed
along just fine.

Any ideas?

PS: I start screen with `term' set to `xterm'

--
Suvayu

Open source is the future. It sets us free.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-21-2011, 01:15 PM
Andras Simon
 
Default Key bindings for screen

2011/10/21, suvayu ali <fatkasuvayu+linux@gmail.com>:
> Hi everyone,
>
> I have been trying to setup some keybindings for screen but have been
> rather unsuccessful so far. The documentation is very difficult to
> understand / follow for me. I was wondering if someone could help me
> understand how to specify key combinations with modifier keys.
>
> I want to be able to switch terminals with either `escape key
> <arrow>' or `escape key C-<arrow>'. I would also like to change
> my escape key from C-a to C-q (easier to navigate in bash and
> emacs). These are my attempts so far:
>
> 1. Switching terminals: I tried the following for `escape key
> <arrow>', but it doesn't work.
>
> bindkey -d ^[[D prev
> bindkey -d ^[[C next
>
> Then I tried the following for `escape key C-<arrow>'.
>
> bindkey -d ^[[1;5D prev
> bindkey -d ^[[1;5C next
>
> This somewhat works. The problem now is, after swithing the terminals
> if I press the escape key for a subsequent command it is interpreted
> as the concluding part of a C-a C-a sequence and screen switches to
> the original terminal. To give you an example a sequence like this,
> `C-a C-<left> C-a A' is interpreted as `prev other A' instead of
> `prev title'.
>
> 2. Changing the escape key: This is more of an issue with the terminal
> emulator rather than screen. My terminal emulator (xfce4 terminal)
> doesn't pass on the C-q to screen. Strangely when I run emacs in the
> terminal (emacs -nw) or I run emacs within screen, C-q is passed
> along just fine.
>
> Any ideas?


How about screen's own bind command (see man screen)?
I haven't used it, but that's what I would look at first.

The C-q problem might be related to flow control. Try to turn it off
or use auto mode in screen (C-a C-f).

HTH,
Andras
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-21-2011, 01:54 PM
suvayu ali
 
Default Key bindings for screen

Hi Andras,

Thank you for your response.

On Fri, Oct 21, 2011 at 3:15 PM, Andras Simon <szajmi@gmail.com> wrote:
>
> How about screen's own bind command (see man screen)?
> I haven't used it, but that's what I would look at first.
>

I have tried that too. For lines like these,

bind ^a^[[D prev
bind ^a^[[C next

I get an error like this:

bind character ^x, or (octal) 32 expected.

> The C-q problem might be related to flow control. Try to turn it off
> or use auto mode in screen (C-a C-f).
>

I started screen with the default escape key, then I did C-a C-f
followed by C-a : escape ^qq RET. I still got the same behaviour.

Howeever, I will try to see if I can find something along these lines.
Thanks for the hint.

--
Suvayu

Open source is the future. It sets us free.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-21-2011, 03:02 PM
Andras Simon
 
Default Key bindings for screen

2011/10/21, suvayu ali <fatkasuvayu+linux@gmail.com>:
> Hi Andras,
>
> Thank you for your response.
>
> On Fri, Oct 21, 2011 at 3:15 PM, Andras Simon <szajmi@gmail.com> wrote:
>>
>> How about screen's own bind command (see man screen)?
>> I haven't used it, but that's what I would look at first.
>>
>
> I have tried that too. For lines like these,
>
> bind ^a^[[D prev
> bind ^a^[[C next
>
> I get an error like this:
>
> bind character ^x, or (octal) 32 expected.

Are you sure you need that ^a there? I'd think that's not part of the
key. Also, if I were you, I'd try a simple key (one corresponding to a
printable ascii character) first, not the cursor keys. Who knows what
special syntax those need to be specified in.


> I started screen with the default escape key, then I did C-a C-f
> followed by C-a : escape ^qq RET. I still got the same behaviour.
>
> Howeever, I will try to see if I can find something along these lines.

Good luck!

> Thanks for the hint.

You're welcome.

Andras
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-21-2011, 03:27 PM
suvayu ali
 
Default Key bindings for screen

On Fri, Oct 21, 2011 at 5:02 PM, Andras Simon <szajmi@gmail.com> wrote:
>> I have tried that too. For lines like these,
>>
>> *bind ^a^[[D prev
>> *bind ^a^[[C next
>>
>> I get an error like this:
>>
>> *bind character ^x, or (octal) 32 expected.
>
> Are you sure you need that ^a there? I'd think that's not part of the
> key. Also, if I were you, I'd try a simple key (one corresponding to a
> printable ascii character) first, not the cursor keys. Who knows what
> special syntax those need to be specified in.
>

I have tried that, without the ^a it simply ignores the cursor keys.
That said a line like this (with printable characters) work as expected:

bind ' ' windowlist -b

The above shows me the windowlist on pressing C-a <space> in screen.
Similarly this attempt to interchange C-a n and C-a p also works.

bind n prev
bind p next

Am I getting the cursor key codes wrong? I am getting the ASCII values
by quoting the cursor keys with C-v in bash. Is there a way to get the
octal numbers somehow?

--
Suvayu

Open source is the future. It sets us free.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-21-2011, 04:17 PM
Andras Simon
 
Default Key bindings for screen

2011/10/21, suvayu ali <fatkasuvayu+linux@gmail.com>:
> On Fri, Oct 21, 2011 at 5:02 PM, Andras Simon <szajmi@gmail.com> wrote:
>>> I have tried that too. For lines like these,
>>>
>>> bind ^a^[[D prev
>>> bind ^a^[[C next
>>>
>>> I get an error like this:
>>>
>>> bind character ^x, or (octal) 32 expected.
>>
>> Are you sure you need that ^a there? I'd think that's not part of the
>> key. Also, if I were you, I'd try a simple key (one corresponding to a
>> printable ascii character) first, not the cursor keys. Who knows what
>> special syntax those need to be specified in.
>>
>
> I have tried that, without the ^a it simply ignores the cursor keys.
> That said a line like this (with printable characters) work as expected:
>
> bind ' ' windowlist -b
>
> The above shows me the windowlist on pressing C-a <space> in screen.
> Similarly this attempt to interchange C-a n and C-a p also works.
>
> bind n prev
> bind p next

OK, so it works (and you don't need the escape key, as expected, based
on the man page).

>
> Am I getting the cursor key codes wrong?

Yes, probably.

> I am getting the ASCII values
> by quoting the cursor keys with C-v in bash. Is there a way to get the
> octal numbers somehow?

Now that you know where the problem lies, a little googling combined
with some experimentation should get you there (or leave you
frustrated :-)). I'm sorry I can't be of more help.

Andras

Andras
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-21-2011, 11:36 PM
suvayu ali
 
Default Key bindings for screen

Hi Andras,

On Fri, Oct 21, 2011 at 6:17 PM, Andras Simon <szajmi@gmail.com> wrote:
> 2011/10/21, suvayu ali <fatkasuvayu+linux@gmail.com>:
>> I have tried that, without the ^a it simply ignores the cursor keys.
>> That said a line like this (with printable characters) work as expected:
>>
>> bind ' ' windowlist -b
>>
>> The above shows me the windowlist on pressing C-a <space> in screen.
>> Similarly this attempt to interchange C-a n and C-a p also works.
>>
>> bind n prev
>> bind p next
>
> OK, so it works (and you don't need the escape key, as expected, based
> on the man page).
>
>>
>> Am I getting the cursor key codes wrong?
>
> Yes, probably.
>
>> I am getting the ASCII values
>> by quoting the cursor keys with C-v in bash. Is there a way to get the
>> octal numbers somehow?
>
> Now that you know where the problem lies, a little googling combined
> with some experimentation should get you there (or leave you
> frustrated :-)). I'm sorry I can't be of more help.
>

I already did a fare share of google searches before posting. However I
just found out that cursor keys are represented by a _pair_ of key
codes, the first is a dummy of some sort (and is probably just 0!).
Probably that is why binding them seems to be such a challenge.

Anyway, you have given me enough direction. A *huge* thank you for that.
I will try to find out more from other resources. If I find a solution,
I will post back.

Best,

--
Suvayu

Open source is the future. It sets us free.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 01:22 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org