How to bind 'tab' and 'shift+tab' in GNU screen?












4














How do I bind the keys Tab and ShiftTab in screen? My problem is that I don’t know what to pass to the screen bind command to designate these keystrokes.



BTW, I’m aware of GNU screen: move between regions but the answer is not there.



All of the following fail with the error -X: bind: character, ^x, or (octal) 32 expected:



screen -X bind "33[Z" focus up
screen -X bind "^[[Z" focus up
screen -X bind "t" focus up
screen -X bind 33[Z focus up
screen -X bind ^[[Z focus up
screen -X bind t focus up


Same thing if I hit CtrlA: to input the command.










share|improve this question
























  • @StephaneChazelas I would agree, except that: 1) other people might find this question useful if they're looking for this particular case; 2) I still couldn't find exactly what to pass to bind to make this work - see (upcoming) edit
    – ricab
    Oct 25 '13 at 13:52










  • OK, retracting the close vote since it's a newer question now. Unfortunately, the way SE works, unless all the other closers retract their close votes, it's likely to end up being closed...
    – Stéphane Chazelas
    Oct 25 '13 at 14:37










  • Please reopen, that was me closing it by mistake.
    – Stéphane Chazelas
    Oct 28 '13 at 15:12










  • @StephaneChazelas: something I should do to reopen?
    – ricab
    Oct 28 '13 at 16:16










  • Nope. Wait for enough people with enough reputation to vote for reopen, like for the closing.
    – Stéphane Chazelas
    Oct 28 '13 at 17:31
















4














How do I bind the keys Tab and ShiftTab in screen? My problem is that I don’t know what to pass to the screen bind command to designate these keystrokes.



BTW, I’m aware of GNU screen: move between regions but the answer is not there.



All of the following fail with the error -X: bind: character, ^x, or (octal) 32 expected:



screen -X bind "33[Z" focus up
screen -X bind "^[[Z" focus up
screen -X bind "t" focus up
screen -X bind 33[Z focus up
screen -X bind ^[[Z focus up
screen -X bind t focus up


Same thing if I hit CtrlA: to input the command.










share|improve this question
























  • @StephaneChazelas I would agree, except that: 1) other people might find this question useful if they're looking for this particular case; 2) I still couldn't find exactly what to pass to bind to make this work - see (upcoming) edit
    – ricab
    Oct 25 '13 at 13:52










  • OK, retracting the close vote since it's a newer question now. Unfortunately, the way SE works, unless all the other closers retract their close votes, it's likely to end up being closed...
    – Stéphane Chazelas
    Oct 25 '13 at 14:37










  • Please reopen, that was me closing it by mistake.
    – Stéphane Chazelas
    Oct 28 '13 at 15:12










  • @StephaneChazelas: something I should do to reopen?
    – ricab
    Oct 28 '13 at 16:16










  • Nope. Wait for enough people with enough reputation to vote for reopen, like for the closing.
    – Stéphane Chazelas
    Oct 28 '13 at 17:31














4












4








4


1





How do I bind the keys Tab and ShiftTab in screen? My problem is that I don’t know what to pass to the screen bind command to designate these keystrokes.



BTW, I’m aware of GNU screen: move between regions but the answer is not there.



All of the following fail with the error -X: bind: character, ^x, or (octal) 32 expected:



screen -X bind "33[Z" focus up
screen -X bind "^[[Z" focus up
screen -X bind "t" focus up
screen -X bind 33[Z focus up
screen -X bind ^[[Z focus up
screen -X bind t focus up


Same thing if I hit CtrlA: to input the command.










share|improve this question















How do I bind the keys Tab and ShiftTab in screen? My problem is that I don’t know what to pass to the screen bind command to designate these keystrokes.



BTW, I’m aware of GNU screen: move between regions but the answer is not there.



All of the following fail with the error -X: bind: character, ^x, or (octal) 32 expected:



screen -X bind "33[Z" focus up
screen -X bind "^[[Z" focus up
screen -X bind "t" focus up
screen -X bind 33[Z focus up
screen -X bind ^[[Z focus up
screen -X bind t focus up


Same thing if I hit CtrlA: to input the command.







keyboard-shortcuts gnu-screen






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 20 '18 at 0:18









Rui F Ribeiro

39k1479130




39k1479130










asked Oct 17 '13 at 11:53









ricab

3451313




3451313












  • @StephaneChazelas I would agree, except that: 1) other people might find this question useful if they're looking for this particular case; 2) I still couldn't find exactly what to pass to bind to make this work - see (upcoming) edit
    – ricab
    Oct 25 '13 at 13:52










  • OK, retracting the close vote since it's a newer question now. Unfortunately, the way SE works, unless all the other closers retract their close votes, it's likely to end up being closed...
    – Stéphane Chazelas
    Oct 25 '13 at 14:37










  • Please reopen, that was me closing it by mistake.
    – Stéphane Chazelas
    Oct 28 '13 at 15:12










  • @StephaneChazelas: something I should do to reopen?
    – ricab
    Oct 28 '13 at 16:16










  • Nope. Wait for enough people with enough reputation to vote for reopen, like for the closing.
    – Stéphane Chazelas
    Oct 28 '13 at 17:31


















  • @StephaneChazelas I would agree, except that: 1) other people might find this question useful if they're looking for this particular case; 2) I still couldn't find exactly what to pass to bind to make this work - see (upcoming) edit
    – ricab
    Oct 25 '13 at 13:52










  • OK, retracting the close vote since it's a newer question now. Unfortunately, the way SE works, unless all the other closers retract their close votes, it's likely to end up being closed...
    – Stéphane Chazelas
    Oct 25 '13 at 14:37










  • Please reopen, that was me closing it by mistake.
    – Stéphane Chazelas
    Oct 28 '13 at 15:12










  • @StephaneChazelas: something I should do to reopen?
    – ricab
    Oct 28 '13 at 16:16










  • Nope. Wait for enough people with enough reputation to vote for reopen, like for the closing.
    – Stéphane Chazelas
    Oct 28 '13 at 17:31
















@StephaneChazelas I would agree, except that: 1) other people might find this question useful if they're looking for this particular case; 2) I still couldn't find exactly what to pass to bind to make this work - see (upcoming) edit
– ricab
Oct 25 '13 at 13:52




@StephaneChazelas I would agree, except that: 1) other people might find this question useful if they're looking for this particular case; 2) I still couldn't find exactly what to pass to bind to make this work - see (upcoming) edit
– ricab
Oct 25 '13 at 13:52












OK, retracting the close vote since it's a newer question now. Unfortunately, the way SE works, unless all the other closers retract their close votes, it's likely to end up being closed...
– Stéphane Chazelas
Oct 25 '13 at 14:37




OK, retracting the close vote since it's a newer question now. Unfortunately, the way SE works, unless all the other closers retract their close votes, it's likely to end up being closed...
– Stéphane Chazelas
Oct 25 '13 at 14:37












Please reopen, that was me closing it by mistake.
– Stéphane Chazelas
Oct 28 '13 at 15:12




Please reopen, that was me closing it by mistake.
– Stéphane Chazelas
Oct 28 '13 at 15:12












@StephaneChazelas: something I should do to reopen?
– ricab
Oct 28 '13 at 16:16




@StephaneChazelas: something I should do to reopen?
– ricab
Oct 28 '13 at 16:16












Nope. Wait for enough people with enough reputation to vote for reopen, like for the closing.
– Stéphane Chazelas
Oct 28 '13 at 17:31




Nope. Wait for enough people with enough reputation to vote for reopen, like for the closing.
– Stéphane Chazelas
Oct 28 '13 at 17:31










1 Answer
1






active

oldest

votes


















2














Contrary to bindkey where you can specify character sequences, with bind, the only way is by using bind -k CAP where CAP is a termcap key capability.



For instance,



bind -k ku focus up


works to bind the sequence of character sent upon Up to focus up. For backtab, that should be:



bind -k kB focus up


Unfortunately, for some reason, it doesn't see to work. Not sure why. My first interpretation was wrong. It sounds like it has something to do with with ncurses not handling the termcap equivalent of kcbt correctly:



$ infocmp -1 | grep Z
cbt=E[Z,
kcbt=E[Z,
$ infocmp -1C | grep Z
:bt=E[Z:


(kcbt is no translated to kB).



If I add to my ~/.screenrc:



 termcapinfo * kr=E[Z
bind -k kr focus up


That is, if I tell screen that whatever the host termincal (*), F63 (kr) sends E[Z, and bind F63 to focus up, then that works. However note that pressing Shift+Tab now sends within screen EOC, which is the character sequence that the terminal emulator that screen implements (as opposed to the host terminal) sends upon F63.






share|improve this answer























  • I didn't quite get this answer and it didn't work for me. bind doesn't have a -k option here (at least not documented). I get also "character, ^x, or (octal) 32 expected" with your bind cmds. But thanks for the help anyway
    – ricab
    Oct 28 '13 at 14:02










  • OK I figured you probably meant bindkey instead of bind. Tried that and it now Shift+TAB does focus up. But not after Ctrl+A as with tab, so it is still no symmetric. I basically wanted to have C-a shit-tab be the symmetric of the default C-a tab
    – ricab
    Oct 28 '13 at 14:09






  • 1




    @ricab, bind -k works for me though it's not documented (4.01.00devel)
    – Stéphane Chazelas
    Oct 28 '13 at 15:11










  • Interesting, it does not work here (4.00.03 (FAU)). I get the error bind: character, ^x, or (octal) 32 expected
    – ricab
    Oct 28 '13 at 16:19






  • 1




    regarding "(kcbt is no translated to kB)." -- that's probably because the termcap was trimmed to fit in 1023 bytes (expected behavior).
    – Thomas Dickey
    Dec 20 '18 at 2:24













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f96470%2fhow-to-bind-tab-and-shifttab-in-gnu-screen%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Contrary to bindkey where you can specify character sequences, with bind, the only way is by using bind -k CAP where CAP is a termcap key capability.



For instance,



bind -k ku focus up


works to bind the sequence of character sent upon Up to focus up. For backtab, that should be:



bind -k kB focus up


Unfortunately, for some reason, it doesn't see to work. Not sure why. My first interpretation was wrong. It sounds like it has something to do with with ncurses not handling the termcap equivalent of kcbt correctly:



$ infocmp -1 | grep Z
cbt=E[Z,
kcbt=E[Z,
$ infocmp -1C | grep Z
:bt=E[Z:


(kcbt is no translated to kB).



If I add to my ~/.screenrc:



 termcapinfo * kr=E[Z
bind -k kr focus up


That is, if I tell screen that whatever the host termincal (*), F63 (kr) sends E[Z, and bind F63 to focus up, then that works. However note that pressing Shift+Tab now sends within screen EOC, which is the character sequence that the terminal emulator that screen implements (as opposed to the host terminal) sends upon F63.






share|improve this answer























  • I didn't quite get this answer and it didn't work for me. bind doesn't have a -k option here (at least not documented). I get also "character, ^x, or (octal) 32 expected" with your bind cmds. But thanks for the help anyway
    – ricab
    Oct 28 '13 at 14:02










  • OK I figured you probably meant bindkey instead of bind. Tried that and it now Shift+TAB does focus up. But not after Ctrl+A as with tab, so it is still no symmetric. I basically wanted to have C-a shit-tab be the symmetric of the default C-a tab
    – ricab
    Oct 28 '13 at 14:09






  • 1




    @ricab, bind -k works for me though it's not documented (4.01.00devel)
    – Stéphane Chazelas
    Oct 28 '13 at 15:11










  • Interesting, it does not work here (4.00.03 (FAU)). I get the error bind: character, ^x, or (octal) 32 expected
    – ricab
    Oct 28 '13 at 16:19






  • 1




    regarding "(kcbt is no translated to kB)." -- that's probably because the termcap was trimmed to fit in 1023 bytes (expected behavior).
    – Thomas Dickey
    Dec 20 '18 at 2:24


















2














Contrary to bindkey where you can specify character sequences, with bind, the only way is by using bind -k CAP where CAP is a termcap key capability.



For instance,



bind -k ku focus up


works to bind the sequence of character sent upon Up to focus up. For backtab, that should be:



bind -k kB focus up


Unfortunately, for some reason, it doesn't see to work. Not sure why. My first interpretation was wrong. It sounds like it has something to do with with ncurses not handling the termcap equivalent of kcbt correctly:



$ infocmp -1 | grep Z
cbt=E[Z,
kcbt=E[Z,
$ infocmp -1C | grep Z
:bt=E[Z:


(kcbt is no translated to kB).



If I add to my ~/.screenrc:



 termcapinfo * kr=E[Z
bind -k kr focus up


That is, if I tell screen that whatever the host termincal (*), F63 (kr) sends E[Z, and bind F63 to focus up, then that works. However note that pressing Shift+Tab now sends within screen EOC, which is the character sequence that the terminal emulator that screen implements (as opposed to the host terminal) sends upon F63.






share|improve this answer























  • I didn't quite get this answer and it didn't work for me. bind doesn't have a -k option here (at least not documented). I get also "character, ^x, or (octal) 32 expected" with your bind cmds. But thanks for the help anyway
    – ricab
    Oct 28 '13 at 14:02










  • OK I figured you probably meant bindkey instead of bind. Tried that and it now Shift+TAB does focus up. But not after Ctrl+A as with tab, so it is still no symmetric. I basically wanted to have C-a shit-tab be the symmetric of the default C-a tab
    – ricab
    Oct 28 '13 at 14:09






  • 1




    @ricab, bind -k works for me though it's not documented (4.01.00devel)
    – Stéphane Chazelas
    Oct 28 '13 at 15:11










  • Interesting, it does not work here (4.00.03 (FAU)). I get the error bind: character, ^x, or (octal) 32 expected
    – ricab
    Oct 28 '13 at 16:19






  • 1




    regarding "(kcbt is no translated to kB)." -- that's probably because the termcap was trimmed to fit in 1023 bytes (expected behavior).
    – Thomas Dickey
    Dec 20 '18 at 2:24
















2












2








2






Contrary to bindkey where you can specify character sequences, with bind, the only way is by using bind -k CAP where CAP is a termcap key capability.



For instance,



bind -k ku focus up


works to bind the sequence of character sent upon Up to focus up. For backtab, that should be:



bind -k kB focus up


Unfortunately, for some reason, it doesn't see to work. Not sure why. My first interpretation was wrong. It sounds like it has something to do with with ncurses not handling the termcap equivalent of kcbt correctly:



$ infocmp -1 | grep Z
cbt=E[Z,
kcbt=E[Z,
$ infocmp -1C | grep Z
:bt=E[Z:


(kcbt is no translated to kB).



If I add to my ~/.screenrc:



 termcapinfo * kr=E[Z
bind -k kr focus up


That is, if I tell screen that whatever the host termincal (*), F63 (kr) sends E[Z, and bind F63 to focus up, then that works. However note that pressing Shift+Tab now sends within screen EOC, which is the character sequence that the terminal emulator that screen implements (as opposed to the host terminal) sends upon F63.






share|improve this answer














Contrary to bindkey where you can specify character sequences, with bind, the only way is by using bind -k CAP where CAP is a termcap key capability.



For instance,



bind -k ku focus up


works to bind the sequence of character sent upon Up to focus up. For backtab, that should be:



bind -k kB focus up


Unfortunately, for some reason, it doesn't see to work. Not sure why. My first interpretation was wrong. It sounds like it has something to do with with ncurses not handling the termcap equivalent of kcbt correctly:



$ infocmp -1 | grep Z
cbt=E[Z,
kcbt=E[Z,
$ infocmp -1C | grep Z
:bt=E[Z:


(kcbt is no translated to kB).



If I add to my ~/.screenrc:



 termcapinfo * kr=E[Z
bind -k kr focus up


That is, if I tell screen that whatever the host termincal (*), F63 (kr) sends E[Z, and bind F63 to focus up, then that works. However note that pressing Shift+Tab now sends within screen EOC, which is the character sequence that the terminal emulator that screen implements (as opposed to the host terminal) sends upon F63.







share|improve this answer














share|improve this answer



share|improve this answer








edited Oct 25 '13 at 20:42

























answered Oct 25 '13 at 15:03









Stéphane Chazelas

299k54564913




299k54564913












  • I didn't quite get this answer and it didn't work for me. bind doesn't have a -k option here (at least not documented). I get also "character, ^x, or (octal) 32 expected" with your bind cmds. But thanks for the help anyway
    – ricab
    Oct 28 '13 at 14:02










  • OK I figured you probably meant bindkey instead of bind. Tried that and it now Shift+TAB does focus up. But not after Ctrl+A as with tab, so it is still no symmetric. I basically wanted to have C-a shit-tab be the symmetric of the default C-a tab
    – ricab
    Oct 28 '13 at 14:09






  • 1




    @ricab, bind -k works for me though it's not documented (4.01.00devel)
    – Stéphane Chazelas
    Oct 28 '13 at 15:11










  • Interesting, it does not work here (4.00.03 (FAU)). I get the error bind: character, ^x, or (octal) 32 expected
    – ricab
    Oct 28 '13 at 16:19






  • 1




    regarding "(kcbt is no translated to kB)." -- that's probably because the termcap was trimmed to fit in 1023 bytes (expected behavior).
    – Thomas Dickey
    Dec 20 '18 at 2:24




















  • I didn't quite get this answer and it didn't work for me. bind doesn't have a -k option here (at least not documented). I get also "character, ^x, or (octal) 32 expected" with your bind cmds. But thanks for the help anyway
    – ricab
    Oct 28 '13 at 14:02










  • OK I figured you probably meant bindkey instead of bind. Tried that and it now Shift+TAB does focus up. But not after Ctrl+A as with tab, so it is still no symmetric. I basically wanted to have C-a shit-tab be the symmetric of the default C-a tab
    – ricab
    Oct 28 '13 at 14:09






  • 1




    @ricab, bind -k works for me though it's not documented (4.01.00devel)
    – Stéphane Chazelas
    Oct 28 '13 at 15:11










  • Interesting, it does not work here (4.00.03 (FAU)). I get the error bind: character, ^x, or (octal) 32 expected
    – ricab
    Oct 28 '13 at 16:19






  • 1




    regarding "(kcbt is no translated to kB)." -- that's probably because the termcap was trimmed to fit in 1023 bytes (expected behavior).
    – Thomas Dickey
    Dec 20 '18 at 2:24


















I didn't quite get this answer and it didn't work for me. bind doesn't have a -k option here (at least not documented). I get also "character, ^x, or (octal) 32 expected" with your bind cmds. But thanks for the help anyway
– ricab
Oct 28 '13 at 14:02




I didn't quite get this answer and it didn't work for me. bind doesn't have a -k option here (at least not documented). I get also "character, ^x, or (octal) 32 expected" with your bind cmds. But thanks for the help anyway
– ricab
Oct 28 '13 at 14:02












OK I figured you probably meant bindkey instead of bind. Tried that and it now Shift+TAB does focus up. But not after Ctrl+A as with tab, so it is still no symmetric. I basically wanted to have C-a shit-tab be the symmetric of the default C-a tab
– ricab
Oct 28 '13 at 14:09




OK I figured you probably meant bindkey instead of bind. Tried that and it now Shift+TAB does focus up. But not after Ctrl+A as with tab, so it is still no symmetric. I basically wanted to have C-a shit-tab be the symmetric of the default C-a tab
– ricab
Oct 28 '13 at 14:09




1




1




@ricab, bind -k works for me though it's not documented (4.01.00devel)
– Stéphane Chazelas
Oct 28 '13 at 15:11




@ricab, bind -k works for me though it's not documented (4.01.00devel)
– Stéphane Chazelas
Oct 28 '13 at 15:11












Interesting, it does not work here (4.00.03 (FAU)). I get the error bind: character, ^x, or (octal) 32 expected
– ricab
Oct 28 '13 at 16:19




Interesting, it does not work here (4.00.03 (FAU)). I get the error bind: character, ^x, or (octal) 32 expected
– ricab
Oct 28 '13 at 16:19




1




1




regarding "(kcbt is no translated to kB)." -- that's probably because the termcap was trimmed to fit in 1023 bytes (expected behavior).
– Thomas Dickey
Dec 20 '18 at 2:24






regarding "(kcbt is no translated to kB)." -- that's probably because the termcap was trimmed to fit in 1023 bytes (expected behavior).
– Thomas Dickey
Dec 20 '18 at 2:24




















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f96470%2fhow-to-bind-tab-and-shifttab-in-gnu-screen%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre