Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No prompt (“>>>”) is displayed on Win10 #428

Closed
zhekaus opened this issue Oct 9, 2017 · 10 comments
Closed

No prompt (“>>>”) is displayed on Win10 #428

zhekaus opened this issue Oct 9, 2017 · 10 comments

Comments

@zhekaus
Copy link

zhekaus commented Oct 9, 2017

If I run psysh inside GitBash or Cygwin, no prompt (">>>") is displayed. Arrows up&down doesn’t list the history. However, other things seemingly work.
There is no such a problem with cmd.exe. However, it sacrifices the colorful output.

Win10, Psy Shell v0.8.11 (PHP 7.1.10 — cli)

@bobthecow
Copy link
Owner

Can you paste the output of Psy\info()?

Shell history requires readline, and I believe this isn’t available in PHP under Windows. It can be installed in Cygwin, but might require a —with-readline flag?

The prompt should be showing up, though. I’ll take a look at that.

@zhekaus
Copy link
Author

zhekaus commented Oct 9, 2017

Psy\info()
=> [
     "PsySH version" => "v0.8.11",
     "PHP version" => "7.1.10",
     "default includes" => [],
     "require semicolons" => false,
     "error logging level" => 32767,
     "config file" => [
       "default config file" => null,
       "local config file" => null,
       "PSYSH_CONFIG env" => false,
     ],
     "updates" => [
       "update available" => false,
       "latest release version" => "v0.8.11",
       "update check interval" => "weekly",
       "update cache file" => "~/AppData/Roaming/PsySH/update_check.json",
     ],
     "pcntl" => [
       "pcntl available" => false,
       "posix available" => false,
     ],
     "readline" => [
       "readline available" => true,
       "readline enabled" => true,
       "readline service" => "Psy\Readline\Libedit",
     ],
     "history" => [
       "history file" => "~/AppData/Roaming/PsySH/psysh_history",
       "history size" => null,
       "erase duplicates" => null,
     ],
     "docs" => [
       "manual db file" => null,
       "sqlite available" => true,
     ],
     "autocomplete" => [
       "tab completion enabled" => true,
       "custom matchers" => [],
     ],
   ]

@zhekaus
Copy link
Author

zhekaus commented Oct 9, 2017

I'm not sure about -with-readline flag... Where should I put it?

@bobthecow
Copy link
Owner

Looks like you've got readline anyway. It should be working :(

@bobthecow
Copy link
Owner

Readline support under Cygwin appears to be incomplete. See this comment on php.net:

http://php.net/manual/en/function.readline.php#121244

Closing this because there's not much we can do on our end. Sorry :(

@kip-13
Copy link

kip-13 commented Apr 22, 2018

I figured out how resolve this problem in cygwin or babun(based on cygwin)

In babun you need to use the package manager pact(included) to download the correct PHP binary compatible and other packages to work correctly:

$ pact install php php-posix php-mbstring ....

In cygwin you need to use apt-cyg(use the binary from here) or pact(too) to do the same:

$ apt-cyg install php php-posix php-mbstring ....

The situation with GitBash for Windows is that is a MSYS based on MinGW not compatible with POSIX and use the binary of PHP to Windows that have problems with readline funcs.

@bobthecow
Copy link
Owner

Thanks @kip-13!

Do you mind starting a page in the wiki about this?

@kip-13
Copy link

kip-13 commented Apr 24, 2018

I'll write about this in a page @bobthecow, maybe in Installation section like other item in "More installation info" ?

@bobthecow
Copy link
Owner

Sure. Thank you!

@kip-13
Copy link

kip-13 commented Apr 26, 2018

@bobthecow, added the page in the wiki, let me know if it's correct for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants