|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52755 Command line is appending a tab when using bash autocompletion via a php script
Submitted: 2010-08-31 23:19 UTC Modified: 2010-09-01 06:27 UTC
From: hassenbentanfous at gmail dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.2.14 OS: Ubuntu hardy linux 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: hassenbentanfous at gmail dot com
New email:
PHP Version: OS:


 [2010-08-31 23:19 UTC] hassenbentanfous at gmail dot com
In order to write a bash autocompletion program using php, you need two 
simple files.

1. bash script
2. php file processing the command and printing it

In this case, the autocomplete works but a "tab" is appended to the output 
making it useless

The php script contains a simple "echo".
If I print the echo in python or ruby, it works properly (no tabs appended) and 
each time I press tab the command is printed.
That's how it should work for php as well.

Test script:

        local cur
        unset COMP_WORDS[0] #remove "j" from the array
        IFS=$'\n\n' read -d '' -a COMPREPLY < <($scriptPath --completion "$cur")
        return 0
complete -F _dda dda

alias dda=$scriptPath


echo "hello";

Expected result:
"hello" should be appended each time I press "TAB"

Actual result:
Tabs are appended


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-01 06:27 UTC]
-Status: Open +Status: Bogus
 [2010-09-01 06:27 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Oct 03 12:01:26 2023 UTC