LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-21-2006, 02:04 PM   #1
athanatos
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, OpenBSD 4.0
Posts: 58

Rep: Reputation: 15
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?
 
Old 07-21-2006, 06:01 PM   #2
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
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?
 
Old 07-21-2006, 06:31 PM   #3
athanatos
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, OpenBSD 4.0
Posts: 58

Original Poster
Rep: Reputation: 15
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!

Last edited by athanatos; 07-21-2006 at 06:45 PM.
 
Old 07-21-2006, 06:34 PM   #4
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
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)

Last edited by raska; 07-21-2006 at 06:35 PM.
 
Old 07-21-2006, 06:50 PM   #5
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
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.
 
Old 07-21-2006, 06:57 PM   #6
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
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.
 
Old 07-21-2006, 06:58 PM   #7
athanatos
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, OpenBSD 4.0
Posts: 58

Original Poster
Rep: Reputation: 15
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).

Last edited by athanatos; 07-21-2006 at 07:01 PM.
 
Old 07-21-2006, 07:24 PM   #8
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
@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.
 
Old 07-21-2006, 07:46 PM   #9
athanatos
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, OpenBSD 4.0
Posts: 58

Original Poster
Rep: Reputation: 15
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.
 
Old 07-21-2006, 08:13 PM   #10
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
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.
 
Old 07-21-2006, 08:31 PM   #11
athanatos
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, OpenBSD 4.0
Posts: 58

Original Poster
Rep: Reputation: 15
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]+[?]
 
Old 07-22-2006, 12:29 PM   #12
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
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.
 
Old 07-22-2006, 12:47 PM   #13
athanatos
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, OpenBSD 4.0
Posts: 58

Original Poster
Rep: Reputation: 15
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
question about bash completion Guest1234 Linux - Software 4 02-25-2006 04:09 PM
Can we enable bash completion in Sarge?How?Please help... deepclutch Debian 6 12-02-2005 07:02 PM
auto-completion in bash with wildcards juanbobo Linux - Software 2 04-07-2005 12:56 AM
xterm start with sh instead of bash freeindy Linux - Software 4 04-25-2004 10:58 AM
Difference between bash and xterm krackerroot Red Hat 4 09-08-2003 10:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration