LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   xterm and bash completion (http://www.linuxquestions.org/questions/slackware-14/xterm-and-bash-completion-466311/)

athanatos 07-21-2006 02:04 PM

xterm and bash completion
 
When pressing control+shift+? in a bash shell it should return all possible completions. Unfortunately this doesn't work in xterm. When I press control+shift+? the following character gets displayed:

I have never used this character and I don't need it, i want to have the default action (displaying possible completions), it is working in rxvt, aterm and in the kde konsole but not in xterm!

Does anyone know how to fix that?

unreal128 07-21-2006 06:01 PM

Can you explain more what you mean by completions? Are you refering to command history or the equivalent of the tab key in bash to auto complete commands that haven't been fully typed in?

athanatos 07-21-2006 06:31 PM

Sorry,
the question was dumb...

I made a mistake:

I did not meant "control+shift+?", I meant "alt+?". The reason I confused this is because I have a german keyboard.

I am talking about commands (or file names) that haven't been fully typed in. So, for example, if I am in a directory with 4 files in it:

Code:

$ ls -l
total 0
-rw-r--r--  1 max users 0 2006-07-22 01:16 afile
-rw-r--r--  1 max users 0 2006-07-22 01:16 afile1
-rw-r--r--  1 max users 0 2006-07-22 01:16 file
-rw-r--r--  1 max users 0 2006-07-22 01:16 file1

When typing 'ls af' and then "alt+?" I get the following result in aterm:

Code:

$ ls af (pressing 'alt+?')
afile  afile1 
$ ls af

When I type 'ls fi' followed by "alt+?":

Code:

$ ls fi
file  file1 
$ ls fi

This does not work in xterm and I don't have a clue why..

Instead, when pressing "alt+?" the following symbol is written:



I want to be able to use this kind of completion in xterm.

Thanks for answering!

raska 07-21-2006 06:34 PM

I don't know for xterm properly, but I always get completion pressing [TAB] twice

PS: I did get it too by pressing [ALT]+[?] (note: getting a [?] with the US keyboard implies pressing [shift] too)

unreal128 07-21-2006 06:50 PM

No worries athanatos, just needed a little clarification. ;)

When you are in xterm, type in
Code:

echo $SHELL
. It is possible it is invoking a shell other than Bash (which supports this feature.)

Let me know what you find.

raska 07-21-2006 06:57 PM

I was checking with xterm. It does the completion by pressing [TAB] twice.

athanatos, could you confirm this if it's working ok for you too?

@unreal128
xterm uses bash as shell, or any that the user has defined, don't mess the things up.

athanatos 07-21-2006 06:58 PM

Hi!

$SHELL is set to '/bin/bash'. [ALT]+[?] works correctly with every other virtual terminal I've tried so far (rxvt, aterm, kde konsole), but not xterm..

@raska
pressing tab twice is working correctly. I was just wondering if it is possible to get [ALT]+[?] working normally in xterm (pressing tab twice has not exactly the same effect).

unreal128 07-21-2006 07:24 PM

@raska
Thanks for the clarification. So for future reference, does xterm inherit the profile by the user instantiating it or is it a setting in a file?

@athanatos
I have a US keyboard layout and alt+? works for me in xterm. I would check the key bindings for xterm and maybe we can compare to see how it is different. BTW, do you have a US keyboard laying around? Maybe we could hook it up, temporarily alter the XFree86 config file to use "us" and see if it works.

athanatos 07-21-2006 07:46 PM

Quote:

Originally Posted by unreal128
BTW, do you have a US keyboard laying around? Maybe we could hook it up, temporarily alter the XFree86 config file to use "us" and see if it works.

I have tried that, but I got the same results (ending up with ).

Quote:

Originally Posted by unreal128
I would check the key bindings for xterm and maybe we can compare to see how it is different.

How to do that? Do you mean the output of 'stty -a'? I have not altered the default xterm settings by the way.

unreal128 07-21-2006 08:13 PM

I think I might have something here. Which shift key are you holding down on; the left or right? I noticed in xterm, it will only work with left alt and shift being held down.

athanatos 07-21-2006 08:31 PM

I tried both shift keys, '' is being printed with the following combinations:

- alt and left shift
- alt and right shift
- I also get when pressing [Alt Gr]+[left/right Shift]+[?]

unreal128 07-22-2006 12:29 PM

Sorry athanatos, it looks like the issue is beyond my skills. :(

You may want to dig into how the keys are mapped (eg. Xmodmap) and see what keycodes are being sent when these keys are being pressed.

athanatos 07-22-2006 12:47 PM

Thank you anyway unreal128 :) !

I think I will take a deep look at various xterm-resources which can be placed in the ~/.Xresources file. If I find something I will post the solution.


All times are GMT -5. The time now is 06:40 PM.