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

fish prompt: preserve pipestatus #1529

Closed
wants to merge 1,781 commits into from

Conversation

krobelus
Copy link
Contributor

The upcoming release fish 3.1.0 provides a variable $pipestatus, that
exposes the exit code of each process in a pipeline. This $pipestatus
is also used by the new default prompt.

Presently, $status is restored but not $pipestatus, so a prompt displaying
the pipestatus is wrong:

expected:

(env) $ false | true | false
(env) [1|0|1] $

actual:

(env) $ false | true | false
(env) [0|1] $

The wrong $pipestatus is because echo 'exit 1' | source is used
to restore the $status.
This commit solves this problem more elegantly by running the user's
prompt immediately, and printing it later.
Uses the fish builtin "string" command which exists since fish 2.3b1
(released April 19, 2016) so that's unlikely to cause problems.

Thanks for contributing a pull request, see checklist all is good!

  • wrote descriptive pull request text
  • added/updated test(s)
  • updated/extended the documentation
  • added news fragment in docs/changelog folder

mattip and others added 30 commits November 17, 2017 16:16
BUG: pypy dlls are named differently
Per the [changelog](https://github.com/pypa/virtualenv/blob/6d8a4ed81f40223a3f9ea1ba5d11be500d9f667a/docs/changes.rst)
notes for `15.1.0`, Python 3.6 is supported. This change adds 3.6 to the
trove classifiers and drops the now-unsupported 3.3.
Upgrade bundled dependencies
Upgrade pip to 9.0.3 and setuptools to 39.0.1
"should filed" --> "should be filed"
Avoid running tests if rebuild-script is making repository
dirty because this means that code was commited
without rebuilding first.

This prevents wasted time on reviews.
Be explicit about where `activate` is and maintain the convention used throughout.
Replaced pypi.python.org with pypi.org in the download URL.
Added `-L` option to `curl` to follow redirects from randomized hash
URLS.

Also, replaced pypi.python.org/pypi with pypi.org/project throughout the
docs.

This fix addresses the most important part of pypa#1042.
* explain .gitignore
* add documentations to tox.ini; python 3.7 to test envs
* add coverage and timeout to tests
* add pyproject.toml and isolated tox build
- now correctly detects current user installation and not just
  those installed at the system level
- for Python versions 3.5+ (which track 32-bit & 64-bit installations
  separately), recognize version tags X.Y, X.Y-32 & X.Y-64 where X.Y
  represents the 64-bit installation if available or 32-bit otherwise
gaborbernat and others added 26 commits October 16, 2019 09:26
Signed-off-by: Bernat Gabor <[email protected]>
* bugfix: allow create env with no-pip

* add changelog

* add rst backticks
Signed-off-by: Bernat Gabor <[email protected]>
pypa/pip@09fd200 moved Pip's `main` function underneath a new `pip._internals.main` module. Playing a risky game, using `pip._internals`. ;-)
From ``41.4.0`` to ``41.6.0``

Signed-off-by: Bernat Gabor <[email protected]>
Signed-off-by: Bernat Gabor <[email protected]>
- also enable all PR triggers CI

Signed-off-by: Bernat Gabor <[email protected]>
The upcoming release fish 3.1.0 provides a variable $pipestatus, that
exposes the exit code of each process in a pipeline. This $pipestatus
is also used by the new default prompt.

Presently, $status is restored but not $pipestatus, so a prompt displaying
the pipestatus is wrong:

expected:

	(env) $ false | true | false
	(env) [1|0|1] $

actual:

	(env) $ false | true | false
	(env) [0|1] $

The wrong $pipestatus is because `echo 'exit 1' | source` is used
to restore the $status.
This commit solves this problem more elegantly by running the user's
prompt immediately, and printing it later.
Uses the fish builtin "string" command which exists since fish 2.3b1
(released April 19, 2016) so that's unlikely to cause problems.
@gaborbernat
Copy link
Contributor

This should be done against the rewrite branch... The master branch soon goes to legacy.

@krobelus krobelus closed this Jan 30, 2020
@krobelus krobelus changed the base branch from master to rewrite January 30, 2020 14:37
@krobelus
Copy link
Contributor Author

Whoops, that blew up when I changed the base branch.
Reopened as #1530.

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

Successfully merging this pull request may close these issues.