awesome

Welcome to awesome bug tracking system.
Tasklist

FS#535 - Tab completion broken for executables in subdirectories

Attached to Project: awesome
Opened by Andreas Kloeckner (inducer) - Tuesday, 16 June 2009, 15:59 GMT
Last edited by Uli Schlachter (psychon) - Wednesday, 09 May 2012, 15:02 GMT
Task Type Bug Report
Category Core
Status Closed
Assigned To Arvydas Sidorenko (Asido)
Operating System All
Severity Low
Priority Normal
Reported Version git/master
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Steps to reproduce:

cd $HOME
mkdir blah
echo "#! /bin/sh" > blah/blubb
chmod +x blah/blubb
Invoke awesome's "run command" thingie
Type blah/b
Hit "Tab"

Observed result:

"blah/b" disappears, gets replaced by "/"

Expected result:

"blah/blubb" gets completed.
This task depends upon

Closed by  Uli Schlachter (psychon)
Wednesday, 09 May 2012, 15:02 GMT
Reason for closing:  Fixed
Additional comments about closing:  commit 3986409e70a3ec5602512c0d9a148ba0a57cb015
Author: Arvydas Sidorenko <asido4@gmail.com>
Date: Sun May 6 23:35:07 2012 +0200

Improved ZSH completion (#535)

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Comment by Andreas Kloeckner (inducer) - Friday, 06 November 2009, 13:26 GMT
I'm having trouble parsing your comment. Are you saying "/" is the expected completion for "blah/b"? If so, can you explain how?

3.4 does the same, BTW.
Comment by Andreas Kloeckner (inducer) - Friday, 06 November 2009, 13:28 GMT
  • Field changed: Percent Complete (100% → 0%)
See last comment.
Comment by Julien Danjou (jd) - Friday, 06 November 2009, 13:29 GMT
I'm sorry, I blindly accepted a task closure made by Ricardo Lucca (rlucca) and it seems it was not the good bug.
Comment by Uli Schlachter (psychon) - Sunday, 20 December 2009, 15:52 GMT
I did the steps as described above to create a file bla/blubb. I then used obvious' popup_run_prompt and the file completion worked fine there.
Then I tried to check if the run_prompt uses the same mechanism for the completion as the default config and noticed that the config doesnt seem to have a "run command" prompt anymore.

So this seems unreproducible and invalid, did I miss sth?
Comment by Uli Schlachter (psychon) - Sunday, 20 December 2009, 15:53 GMT
Ah, sorry, I was being blind.
Found it and the default config does use the same code for the completion.

I'll close this as Unreproducible, feel free to tell me what I did wrong.
Comment by Andreas Kloeckner (inducer) - Sunday, 20 December 2009, 16:19 GMT
Still happens for me on Debian's 3.4.2-2.
Comment by Julien Danjou (jd) - Sunday, 20 December 2009, 17:10 GMT
Check both $SHELL
Comment by Andreas Kloeckner (inducer) - Sunday, 20 December 2009, 17:22 GMT
/usr/bin/zsh
Comment by Uli Schlachter (psychon) - Sunday, 20 December 2009, 18:42 GMT
Bash here and looking at completion.lua I see this:
if shell == "zsh" or (not shell and os.getenv("SHELL"):match("zsh$")) then

I guess that doesn't match the full path used here...

(jd++ btw)
Comment by Uli Schlachter (psychon) - Sunday, 20 December 2009, 22:04 GMT
I installed zsh and started the lua interpreter, then loaded awful.completion

dofile(".build-psytux-x86_64-linux-gnu-4.3.4/lib/awful/completion.lua")

Then I defined the following function:

function f(a, b, c) return awful.completion.shell(a, a:len() + 1, b or 1, c) end

Then I experimented a little:

> return f("/", 1, "bash")
/bin/ 8
> return f("/", 1, "zsh")
/ 4

Via strace I noticed that the following is executed in the zsh case:

execve("/usr/bin/zsh", ["zsh", "-c", "local -a res; res=( \"${(k)commands[@]}\" \"${(k)aliases[@]}\" \"${(k)builtins[@]}\" \"${(k)functions[@]}\" \"${(k)reswords[@]}\" ); print -l -- ${(M)res[@]:#/*}"], [/* 43 vars */]) = 0
[snip]
[pid 9781] execve("/usr/bin/sort", ["sort", "-u"], [/* 43 vars */]) = 0
[snip]
[pid 9782] execve("/bin/sh", ["sh", "-c", "test -d "], [/* 43 vars */]) = 0

test -d exits successfully, that's where the single "/" is coming from (look at the code for details). Now, anyone understands this code and can tell me what's going on?
Comment by Uli Schlachter (psychon) - Sunday, 14 March 2010, 15:00 GMT
Ping, any zsh user out there who can help with this?

Loading...