psysh
psysh copied to clipboard
Tab completion not working
Tab completion is not working for me. I seem to have readline working in my PHP, and I also have the relevant autoloading working. I can't for example use tab completion to complete a method name when typing a method to call. I am using PHP 7.2.16. I am using the latest release of PsySH, 0.9.9.
Can you run \psy\info()
and paste the output?
psysh
Psy Shell v0.9.9 (PHP 7.2.16-1+ubuntu16.04.1+deb.sury.org+1 — cli) by Justin Hileman
>>> \psy\info()
=> [
"PsySH version" => "v0.9.9",
"PHP version" => "7.2.16-1+ubuntu16.04.1+deb.sury.org+1",
"OS" => "Linux",
"default includes" => [],
"require semicolons" => false,
"error logging level" => 32767,
"config file" => [
"default config file" => null,
"local config file" => "~/acs/.psysh.php",
"PSYSH_CONFIG env" => false,
],
"loop listeners" => [
"Psy\ExecutionLoop\ProcessForker",
],
"commands" => [
"help" => "Psy\Command\HelpCommand",
"?" => "Psy\Command\HelpCommand",
"ls" => "Psy\Command\ListCommand",
"list" => "Psy\Command\ListCommand",
"dir" => "Psy\Command\ListCommand",
"dump" => "Psy\Command\DumpCommand",
"doc" => "Psy\Command\DocCommand",
"rtfm" => "Psy\Command\DocCommand",
"man" => "Psy\Command\DocCommand",
"show" => "Psy\Command\ShowCommand",
"wtf" => "Psy\Command\WtfCommand",
"last-exception" => "Psy\Command\WtfCommand",
"wtf?" => "Psy\Command\WtfCommand",
"whereami" => "Psy\Command\WhereamiCommand",
"throw-up" => "Psy\Command\ThrowUpCommand",
"timeit" => "Psy\Command\TimeitCommand",
"trace" => "Psy\Command\TraceCommand",
"buffer" => "Psy\Command\BufferCommand",
"buf" => "Psy\Command\BufferCommand",
"clear" => "Psy\Command\ClearCommand",
"edit" => "Psy\Command\EditCommand",
"sudo" => "Psy\Command\SudoCommand",
"history" => "Psy\Command\HistoryCommand",
"hist" => "Psy\Command\HistoryCommand",
"exit" => "Psy\Command\ExitCommand",
"quit" => "Psy\Command\ExitCommand",
"q" => "Psy\Command\ExitCommand",
],
"updates" => [
"update available" => false,
"latest release version" => "v0.9.9",
"update check interval" => "weekly",
"update cache file" => "~/.config/psysh/update_check.json",
],
"pcntl" => [
"pcntl available" => true,
"posix available" => true,
],
"readline" => [
"readline available" => true,
"readline enabled" => true,
"readline service" => "Psy\Readline\Libedit",
"readline library" => "EditLine wrapper",
],
"history" => [
"history file" => "~/.config/psysh/psysh_history",
"history size" => null,
"erase duplicates" => null,
],
"docs" => [
"manual db file" => null,
"sqlite available" => true,
],
"autocomplete" => [
"tab completion enabled" => true,
"custom matchers" => [],
"bracketed paste" => false,
],
]
@still-dreaming-1 can you look up https://github.com/bobthecow/psysh/issues/435#issuecomment-387756653 - maybe it's similar?
@still-dreaming-1 can you look up #435 (comment) - maybe it's similar?
Hmm, yes I get the same results. So it actually does somewhat work under strange circumstances as you described in that comment, but for many basic use cases it does not work at all.
@still-dreaming-1 I think the root of this problem cannot be found using \psy\info()
. I am now "lucky" to be on a machine where I don't have it. Maybe that's some strange locale issue? Maybe some module (or zend module like xdebug) is causing it? Would be neat to trace this IMO-bug :)
I guess another way to look at this is, what systems/setups is tab completion known to work well on? Does it work well for anyone with a similar setup (Ubuntu 16.04 and PHP 7.2.19)?
This is still not working for me. I am now on Psysh v0.10.4 on Ubuntu 16.04.6. If I create an object instance of a custom class of mine, and then start typing the code to call a method, partway type out the method name I want to call, and then press tab, nothing happens.
Here is my psyinfo
>>> \psy\info();
=> [
"PsySH version" => "v0.10.4",
"PHP version" => "7.4.5",
"OS" => "Linux",
"default includes" => [],
"require semicolons" => false,
"error logging level" => 32767,
"config file" => [
"default config file" => null,
"local config file" => "~/acs/csst/.psysh.php",
"PSYSH_CONFIG env" => false,
],
"loop listeners" => [
"Psy\ExecutionLoop\ProcessForker",
],
"commands" => [
"help" => "Psy\Command\HelpCommand",
"?" => "Psy\Command\HelpCommand",
"ls" => "Psy\Command\ListCommand",
"dir" => "Psy\Command\ListCommand",
"dump" => "Psy\Command\DumpCommand",
"doc" => "Psy\Command\DocCommand",
"rtfm" => "Psy\Command\DocCommand",
"man" => "Psy\Command\DocCommand",
"show" => "Psy\Command\ShowCommand",
"wtf" => "Psy\Command\WtfCommand",
"last-exception" => "Psy\Command\WtfCommand",
"wtf?" => "Psy\Command\WtfCommand",
"whereami" => "Psy\Command\WhereamiCommand",
"throw-up" => "Psy\Command\ThrowUpCommand",
"timeit" => "Psy\Command\TimeitCommand",
"trace" => "Psy\Command\TraceCommand",
"buffer" => "Psy\Command\BufferCommand",
"buf" => "Psy\Command\BufferCommand",
"clear" => "Psy\Command\ClearCommand",
"edit" => "Psy\Command\EditCommand",
"sudo" => "Psy\Command\SudoCommand",
"history" => "Psy\Command\HistoryCommand",
"hist" => "Psy\Command\HistoryCommand",
"exit" => "Psy\Command\ExitCommand",
"quit" => "Psy\Command\ExitCommand",
"q" => "Psy\Command\ExitCommand",
],
"updates" => [
"update available" => false,
"latest release version" => "v0.10.4",
"update check interval" => "weekly",
"update cache file" => "~/.config/psysh/update_check.json",
],
"pcntl" => [
"pcntl available" => true,
"posix available" => true,
"use pcntl" => true,
],
"input" => [
"interactive mode" => "auto",
"input interactive" => true,
],
"readline" => [
"readline available" => true,
"readline enabled" => true,
"readline service" => "Psy\Readline\Libedit",
"readline library" => "EditLine wrapper",
"readline name" => "psysh",
],
"output" => [
"color mode" => "auto",
"output decorated" => null,
"output verbosity" => "normal",
],
"history" => [
"history file" => "~/.config/psysh/psysh_history",
"history size" => null,
"erase duplicates" => null,
],
"docs" => [
"manual db file" => null,
"sqlite available" => true,
],
"autocomplete" => [
"tab completion enabled" => true,
"bracketed paste" => false,
"custom matchers" => [],
],
]
I do have a config file, but all it does is bootstrap into my project (autoload, etc), it doesn't actually specify any psysh config stuff.