Homec4science

Fix phutil_console_prompt() under Ubuntu

Authored by epriestley <git@epriestley.com> on Jun 28 2012, 02:07.

Description

Fix phutil_console_prompt() under Ubuntu

Summary:
In Ubuntu, sh is dash. It doesn't support read -e, but when we run echo $BASH 2>/dev/null it returns "\n", which is true, so we try to run read -e anyway.

Instead, do an explicit test for the availability of bash, and use it if it's available.

Test Plan: Ran scripts/test/prompt.php --history /tmp/h on Ubuntu and got readline instead of an exception about read -e being illegal.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1302

Differential Revision: https://secure.phabricator.com/D2879

Details

Committed
epriestley <git@epriestley.com>Jun 28 2012, 02:07
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU6a201c24d4ca: Minor, add a test script for phutil_console_prompt().
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU51063a4c4744: Fix phutil_console_prompt() under Ubuntu (authored by epriestley <git@epriestley.com>).Jun 28 2012, 02:07