🐚 Python-powered shell. Full-featured and cross-platform.
Find a file
Oliver Bestwalter 81c8fe6bb9
make env_name aware of prompt in pyvenv.cfg (#4673)
* make env_name aware of prompt in pyvenv.cfg

prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.

fixes #4670

* make env_name aware of prompt in pyvenv.cfg

prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.

As the env_name is generated every time the prompt is generated, caching is used to only calculate it once for every venv path.

This introduces the possibility that the user will not get a correct env_name, when they change the cfg file or replace the whole venv and use different prompt settings the second time around. Although this is annoying and potentially confusing, it is still better than the situation before, where the prompt setting was simply ignored, although it is part of venv since python3.6 - so or now this might be seen as acceptable trade-off between speed and correctness.

fixes #4670

* make env_name aware of prompt in pyvenv.cfg

prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.

As the env_name is generated every time the prompt is generated, caching is used to only calculate it once for every venv path.

This introduces the possibility that the user will not get a correct env_name, when they change the cfg file or replace the whole venv and use different prompt settings the second time around. Although this is annoying and potentially confusing, it is still better than the situation before, where the prompt setting was simply ignored, although it is part of venv since python3.6 - so or now this might be seen as acceptable trade-off between speed and correctness.

fixes #4670

* add type annotations

* always return str

This is more consistent and might also deal with a mypy error only observed on Ubuntu Linux python3.9

* remove unnecessary import

* adapt code to not break the documented API

When restructuring the code, I did not know that this was part of a documented API. This restores the API functions and updates the doc strings. New helper functions have been made private.
2022-02-21 23:39:07 +05:30
.github chore: fix generated token for docs push (#4658) 2022-01-26 07:52:47 +05:30
appimage Update pre-requirements.txt (#4073) 2021-01-30 15:13:33 -05:00
ci fix: xonfig web is not upto-date (#4606) 2022-01-18 11:11:16 -05:00
docs Fix: detype None env-vars to '' to fix #4600 (#4649) 2022-01-21 14:46:50 +05:30
news make env_name aware of prompt in pyvenv.cfg (#4673) 2022-02-21 23:39:07 +05:30
requirements feat: add isort to project 2022-01-31 11:16:51 -05:00
scripts re-run CI tests 2020-08-08 14:02:44 -04:00
tests make env_name aware of prompt in pyvenv.cfg (#4673) 2022-02-21 23:39:07 +05:30
xompletions style: isort imports 2022-01-31 11:16:51 -05:00
xonsh make env_name aware of prompt in pyvenv.cfg (#4673) 2022-02-21 23:39:07 +05:30
xontrib implement vox create --prompt (#4676) 2022-02-21 14:51:31 +05:30
.authors.yml Updated authorship for 0.11.0 2021-11-17 15:34:51 -05:00
.coveragerc test: update test configs (#4603) 2021-12-23 06:31:26 +05:30
.gitattributes Remove syntax override for .xsh files (#4554) 2021-11-22 10:07:04 -05:00
.gitignore add py310 (#4270) 2021-06-07 13:40:40 -04:00
.mailmap Updated authorship for 0.11.0 2021-11-17 15:34:51 -05:00
.pre-commit-config.yaml feat: add isort to project 2022-01-31 11:16:51 -05:00
amalgamate.py pre-commit hook for pyupgrade (#4583) 2021-12-06 14:42:26 -05:00
AUTHORS.rst Updated authorship for 0.11.0 2021-11-17 15:34:51 -05:00
CHANGELOG.rst Updated CHANGELOG for 0.11.0 2021-11-17 15:37:41 -05:00
conftest.py use recommended pytest entry point in docs and comments (#4671) 2022-02-19 01:45:45 +05:30
CONTRIBUTING.rst use recommended pytest entry point in docs and comments (#4671) 2022-02-19 01:45:45 +05:30
github_deploy_key.enc publish dev and latest release docs on xonsh-docs 2016-10-20 19:48:38 -04:00
license copyright update 2016-06-30 12:24:55 -04:00
logo.txt accomodate pip bug by making setup.py ascii 2015-11-16 15:12:02 -08:00
Makefile refactor: remove non-source files from ply vendored (#4321) 2021-07-01 09:35:57 -04:00
MANIFEST.in Amalgamated release (#4355) 2021-07-05 20:59:44 +03:00
pyproject.toml feat: add isort to project 2022-01-31 11:16:51 -05:00
README.rst docs: add "The xonsh shell community" to the readme (#4585) 2021-12-03 09:39:19 -05:00
release.xsh Fix deprecation warnings from unallowed escapes 2018-10-05 11:51:08 +02:00
rever.xsh appimage: Upgrade to python 3.9 2021-07-24 14:43:38 +03:00
run-tests.xsh feat: add isort to project 2022-01-31 11:16:51 -05:00
scent.py feat: add setting to set custom function to format prompt 2020-10-25 22:49:22 +05:30
setup.cfg chore: type check xontribs,xompletions (#4642) 2022-01-18 09:54:31 -05:00
setup.py Xompletions (#4521) 2022-01-10 11:21:22 -05:00
xonsh-in-docker.py Make ptk default version much more recent 2020-09-12 20:01:41 -04:00

xonsh
=====

.. class:: center

    **xonsh** is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.

    The language is a superset of Python 3.6+ with additional shell primitives.
    xonsh (pronounced *conch*) is meant for the daily use of experts and novices alike.

    .. image:: https://raw.githubusercontent.com/xonsh/xonsh/main/docs/_static/xonsh5.png
            :alt: What is xonsh?
            :align: center

.. class:: center

    If you like xonsh, :star: the repo, `write a tweet`_ and stay tuned by watching releases.

    .. image:: https://badges.gitter.im/xonsh/xonsh.svg
            :target: https://gitter.im/xonsh/xonsh?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
            :alt: Join the chat at https://gitter.im/xonsh/xonsh

    .. image:: https://img.shields.io/badge/%23xonsh%3Afeneas.org-Matrix-green
            :target: https://matrix.to/#/#xonsh:feneas.org
            :alt: Matrix room: #xonsh:feneas.org

    .. image:: https://travis-ci.org/xonsh/xonsh.svg?branch=main
            :target: https://travis-ci.org/xonsh/xonsh
            :alt: Travis

    .. image:: https://ci.appveyor.com/api/projects/status/github/xonsh/xonsh?svg=true
            :target: https://ci.appveyor.com/project/xonsh/xonsh
            :alt: Appveyor

    .. image:: https://img.shields.io/badge/Google%20Cloud%20Shell-xonsh-green
            :target: https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/xonsh/xonsh.git
            :alt: Open in Google Cloud Shell
    .. image:: https://codecov.io/gh/xonsh/xonsh/branch/master/graphs/badge.svg?branch=main
            :target: https://codecov.io/github/xonsh/xonsh?branch=main
            :alt: codecov.io

First steps
***********

Visit https://xon.sh for more information:

- `Installation <https://xon.sh/contents.html#installation>`_ - using packages, docker or AppImage.
- `Tutorial <https://xon.sh/tutorial.html>`_ - step by step introduction in xonsh.
- `Xontribs <https://xon.sh/xontribs.html>`_ or `Github Xontribs <https://github.com/topics/xontrib>`_ - list of awesome xonsh extensions.

Projects that use xonsh
***********************

- `gitsome <https://github.com/donnemartin/gitsome>`_: A supercharged Git/shell autocompleter with GitHub integration.
- `rever <https://regro.github.io/rever-docs/>`_: Cross-platform software release tool.
- `Regro autotick bot <https://github.com/regro/cf-scripts>`_: Regro Conda-Forge autoticker.
- `xxh <https://github.com/xxh/xxh>`_: Using xonsh wherever you go through the ssh.


The xonsh shell community
*************************

The xonsh shell is developed by a community of volunteers and has no organization that can get grants, donations or additional support. There are two major ways to help the xonsh shell: to spread the good word about xonsh in the world (`write a tweet`_) and to help improve the xonsh shell (`solve an issue <https://github.com/xonsh/xonsh/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc>`_). We welcome new contributors!

.. _write a tweet: https://twitter.com/intent/tweet?text=xonsh%20is%20a%20Python-powered,%20cross-platform,%20Unix-gazing%20shell%20language%20and%20command%20prompt.&url=https://github.com/xonsh/xonsh