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

Fix PHP version formatting #409

Merged
merged 3 commits into from
Apr 4, 2018
Merged

Fix PHP version formatting #409

merged 3 commits into from
Apr 4, 2018

Conversation

patrikziduliak
Copy link
Contributor

Description
There were two issues with PHP version formatting I found. First, more importantly, was that PHP substring itself was matched after grepping php -v. When I execute php -v, there are some warnings however, such as:

PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_pgsql' (tried: /usr/local/Cellar/php/7.2.3_3/lib/php/20170718/pdo_pgsql (dlopen(/usr/local/Cellar/php/7.2.3_3/lib/php/20170718/pdo_pgsql, 9): image not found), /usr/local/Cellar/php/7.2.3_3/lib/php/20170718/pdo_pgsql.so (dlopen(/usr/local/Cellar/php/7.2.3_3/lib/php/20170718/pdo_pgsql.so, 9): image not found)) in Unknown on line 0

These warnings are also matched, and then, awk prints out empty lines. I fixed the pattern so that the version number is not optional.

Also, I added a space before version number, so that it is more consistent (see Node version in the same screenshot).

Screenshot
Before:
image

After:
image

Copy link
Member

@salmanulfarzy salmanulfarzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @patrikziduliak.

sections/php.zsh Outdated

spaceship::section \
"$SPACESHIP_PHP_COLOR" \
"$SPACESHIP_PHP_PREFIX" \
"${SPACESHIP_PHP_SYMBOL}v${php_version}" \
"${SPACESHIP_PHP_SYMBOL} v${php_version}" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed. An empty space is defined with variable.

https://github.com/denysdovhan/spaceship-prompt/blob/5a391a571a0a05a038d880e7359228f6c3525511/sections/php.zsh#L14

php dual space

This might have to do with your terminal unicode width settings. Also note your overlapping package symbol.

@salmanulfarzy salmanulfarzy added the improvement A PR that make small changes for improving UX, performance, readability, etc label Apr 4, 2018
Copy link
Member

@salmanulfarzy salmanulfarzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@salmanulfarzy salmanulfarzy merged commit 0847e99 into spaceship-prompt:master Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement A PR that make small changes for improving UX, performance, readability, etc
Development

Successfully merging this pull request may close these issues.

None yet

3 participants