Commit graph

1027 commits

Author SHA1 Message Date
Andy Kipp
aa69ce868a
Now last executed CommandPipeline is available in `__xonsh__.last` (#5422)
### Motivation

There is no way to access to the CommandPipeline of executed command in
uncaptured mode. This causes:
 * No chance to get return code in one universal way.
 * Barrier to trace and inspection.

### Before

```xsh
$(ls nofile)
# No way to access to the CommandPipeline of executed command.
```

### After
```xsh
$(ls nofile)
__xonsh__.last.rtn  # In interactive or not interactive.
# 2
```
```xsh
# Sugar sir:
last = type('LastCP', (object,), {'__getattr__':lambda self, name: getattr(__xonsh__.last, name) })()

ls nofile
last.rtn
# 2
```

JFYI #5342

## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍
comment**

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-22 09:25:35 -04:00
Andy Kipp
4906ba8598
Update tutorial.rst: remove new line chars (#5382)
Update tutorial.rst
2024-05-02 18:01:06 +02:00
Andy Kipp
c5cb7044b5
feat: add subproc output format, autostrip singleline output (#5377)
### Motivation

* To have an ability to manage the output format added ``$XONSH_SUBPROC_OUTPUT_FORMAT`` to switch the way to return the output lines. Default ``stream_lines`` to return text. Alternative ``list_lines`` to return the list of lines. Also supported custom lambda function.
* Additionally the [proposal to change default behavior](https://github.com/xonsh/xonsh/pull/5377#discussion_r1587627131) for a single line case.
* Closes #3924 as soft solution.

### Before

```xsh
mkdir -p /tmp/tst && cd /tmp/tst && touch 1 2 3

$(ls)
# '1\n2\n3\n'

id $(whoami)
# id: ‘pc\n’: no such user: Invalid argument

du $(ls)
# du: cannot access '1'$'\n''2'$'\n''3'$'\n': No such file or directory

ls $(fzf)
# ls: cannot access 'FUNDING.yml'$'\n': No such file or directory
```

### After

```xsh
mkdir -p /tmp/tst && cd /tmp/tst && touch 1 2 3

$XONSH_SUBPROC_OUTPUT_FORMAT = 'list_lines'

$(ls)
# ['1', '2', '3']

[f for f in $(ls)]
# ['1', '2', '3']

id $(whoami)
# uid=501(user) gid=20(staff)

du $(ls)
# 0 1
# 0 2
# 0 3

ls $(fzf)
# FUNDING.yml

# etc
mkdir -p /tmp/@($(whoami))/dir
cat /etc/passwd | grep $(whoami)
```

### Notes

* It will be good to improve parser for cases like `mkdir -p /tmp/$(whoami)/dir`. PR is welcome!
* I named the default mode as `stream_lines` (instead of just `stream` or `raw`) because in fact we transform raw output into stream of lines and possibly reduce the length of output ([replacing `\r\n` to `\n`](c3a12b2a9c/xonsh/procs/pipelines.py (L380-L383))). May be some day we need to add raw "stream" output format.
* Now anybody can implement bash `IFS` behavior in [bashisms](https://github.com/xonsh/xontrib-bashisms).

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-02 11:48:25 -04:00
Andy Kipp
f71b5adde8
Xonsh Zulip Community started (#5372)
* wip

* wip

---------

Co-authored-by: a <1@1.1>
2024-04-29 10:01:02 -04:00
Daniel Saunders
d4a342f49d
Fix documented default loc parameter for add_one_completer() (#5289)
* Correct documentation about default parameter

* Create DanielSaunders-patch-1.rst
2024-02-27 16:22:12 +01:00
Jason R. Coombs
1d54c74832
Mention VS Code supports xonsh as default shell (#5273)
* Add paragraph about support for xonsh as the default shell.

Ref #4469

Also, updated the text to use 'VS Code', which is the preferred short name.

* Add news entry.
2024-02-06 00:29:45 +01:00
Jacqueline Leykam
f4e979a2f3
correct scandalous misrepresentation of the friendly interactive shell's feature set (#5235)
correct scandalous misrepresentation
2023-11-27 11:12:28 +01:00
Joshix-1
b2b23a8240
add generic on_pre_spec_run and on_post_spec_run (#5232)
* add generic on_pre_spec_run and on_post_spec_run

* black

* edit docs/events.rst

* news

* Update on_pre_spec_run-on_post_spec_run.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2023-11-23 12:19:34 +01:00
mgunyho
bb154fbfd7
Fix typo in installation instructions (#5198) 2023-09-04 17:37:18 +06:00
Andy Kipp
d8249abf38
Update packages.rst: fix link (#5196)
Update packages.rst
2023-09-04 13:51:20 +06:00
ShalokShalom
60f0145ed8
Mention 3.6 instead of 3.5 in docs (#5193)
* Update intro.rst to mention Python 3.6

The homepage mentions 3.6, so I update this section to be in line

* Create upgrade-python-version.rst

Add news item for https://github.com/xonsh/xonsh/pull/5193
2023-08-23 21:30:20 +06:00
pre-commit-ci[bot]
8b0dd5cae7
[pre-commit.ci] pre-commit autoupdate (#5170)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.275 → v0.0.276](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.275...v0.0.276)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-04 22:21:50 +05:30
Andy Kipp
041bfb2d29
Become a sponsor to xonsh (#5167) 2023-07-01 13:15:06 +00:00
Andy Kipp
aaac9f14d0
Add files via upload 2023-05-19 23:01:11 +06:00
Andy Kipp
e1a93cef19
New prompt end character (#5063)
Co-authored-by: a <1@1.1>
2023-05-16 13:36:50 +00:00
Andy Kipp
042487745a
Moving old xontribs to repositories (#5055)
* Update and rename README to README.rst

* Create hello_world.py

* Update README.rst

* init

* remove bashisms

* Transfer abbrevs to xontrib-abbrevs

* Transfer free-cwd to xontrib-free-cwd

* news

* black

* Transfer fish-completer to xonsh/xontrib-fish-completer

* Transfer vox to xonsh/xontrib-vox

* Transfer pdb, xog to xonsh/xontrib-debug-tools

* remove hello_world

* fix tests

* black

* fix whitespaces

* fix readme

* Update python_virtual_environments.rst

* Update README.rst

* Update xontribs_transfer.rst

---------

Co-authored-by: a <1@1.1>
2023-03-17 13:25:22 +06:00
Andy Kipp
54962fb4b9
Mini fix chdir (#5080)
* Update tools.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-04 09:02:55 +05:30
Andy Kipp
4c5c88a72f
Update index.html (#5078)
* Update index.html

* Create xonsh_landing.rst

* remove the quarter msg

---------

Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2023-03-03 00:15:36 +06:00
Andy Kipp
eae3fcc255
Update robots.txt: remove outdated linux.html (#5062)
Update robots.txt
2023-02-17 16:33:57 +06:00
Andy Kipp
ebb6abd200
history pull (#5047)
Co-authored-by: a <aaa@aaa.aaa>
Closes https://github.com/xonsh/xonsh/issues/5044
2023-02-08 08:20:01 -05:00
Gil Forsyth
6cf78656c7
docs: remove reduntant table of contents (#5042)
Fixes https://github.com/xonsh/xonsh/issues/5041
2023-02-02 08:49:52 -05:00
Tobias Becker
d173ad7f3b
Add a warning to the docs about $args in ExecAlias (#5033) 2023-01-17 13:05:39 -05:00
Mark Bestley
1e6faa47ce
Remove python REPL prompts so that you can copy the code (#5022) 2023-01-11 17:27:44 -05:00
Gil Forsyth
bcf2592b7d
doc: remove references to deprecated RC location, update changelog (#5012) 2022-12-14 22:00:15 -05:00
Vasilis Gerakaris
1d61d8d711 Document that xonshrc files not applied on non-interactive mode 2022-10-20 03:20:33 +05:30
Andy Kipp
b836134f0c
Update tutorial_hist.rst: remove description of not implemented logic (#4930)
Update tutorial_hist.rst
2022-09-03 10:02:22 -04:00
Michael Panitz (at Cascadia College)
1dc091fc01
Link to xonsh-specific Windows Terminal info (#4883)
It's weirdly hard to find anything about installing xonsh into Windows Terminal (even though that info's right here on the website).  So link to that hard-to-find info directly; if someone wants to find out what Windows Terminal is they can Google it on their own :)
2022-08-04 07:21:43 -04:00
jgart
8ac9f22d56
docs: Add GNU Guix information (#4891) 2022-07-25 15:35:00 +05:30
Tim Gates
37f6adb159
docs: Fix a few typos (#4889)
There are small typos in:
- docs/python_virtual_environments.rst
- setup.py
- xonsh/procs/specs.py
- xontrib/abbrevs.py

Fixes:
- Should read `interpreter` rather than `intrepreter`.
- Should read `dictionary` rather than `disctionary`.
- Should read `descriptors` rather than `descriptiors`.
- Should read `because` rather than `becuase`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2022-07-23 04:42:46 +05:30
Andy Kipp
2042d78d0d
Removed GTM (#4870)
Update index.html
2022-07-09 15:40:48 +05:30
Andy Kipp
ff7b2741ff
Added Google Tag Manager 2022-07-07 01:41:22 +04:00
Noorhteen Raja NJ
cbf23e60fb
Pre commit ci (#4863) 2022-07-01 11:47:01 -04:00
Noorhteen Raja NJ
3716f3da86
Pr5 xontrib entrypoints (#4827) 2022-06-17 12:39:12 -04:00
Peter Ye
b2c42ed2f3
feat: f-glob strings (#4835)
* feat: add support for f-glob strings

Move xonsh_pathsearch() into the BaseParser class because it needs to use self._set_error()

Parametrize 6 backtick tests in test_parser.py into test_backtick() (and add cases for f-glob strings)

* add news

* docs: update tutorial

* fix news file
2022-06-12 13:45:16 +05:30
Noorhteen Raja NJ
347bf201de
fix: docs building (#4820) 2022-05-30 20:49:38 +05:30
Noorhteen Raja NJ
ecc1ab1020
xontrib load/unload (#4817)
* feat: add function to make event registration from function signature

* docs: add xontrib special functions description

* feat: handle xontribs with special functions

also reduce usage of XSH singleton

* fix: missing XSH

for now import singleton

* docs: fix .rst format

* fix: failing tests

* feat: implement primitive xontrib-unload and xontrib-reload

* chore: give explicit name

* docs: update doc
2022-05-30 15:33:17 +05:30
Gil Forsyth
572ebb576d
docs: change theme to furo (#4809)
Trying out a new theme -- I really like the way `furo` looks and I think
it makes it easier to navigate our overly dense docs pages.
2022-05-18 20:36:45 +05:30
dev2718
e62c0e9cec
Returncode enhancements (#4798)
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2022-05-10 09:43:32 -04:00
Noorhteen Raja NJ
15ff663530
Rm xontrib meta (#4790) 2022-05-04 15:02:20 -04:00
Gil Forsyth
7b0bc0f75a
fix: add M1 bash-completion path to osx defaults (#4740)
* docs: change language choice for "reasonable" behavior

* fix: add M1 bash completion location to defaults on OSX
2022-03-28 21:43:11 +05:30
Noortheen Raja
8cff41b081 chore: move out jupyter, mpl, distributed, jedi xontribs
they are require extra packages for testing and usage
closes #4726
2022-03-24 19:49:30 +05:30
Noorhteen Raja NJ
d49b164379
gitstatus modular (#4697) 2022-03-21 11:18:36 -04:00
E Pluribus Unum
6fc77f2fcb
do to following -> do the following (#4728)
* do to following -> do the following

very minor spelling correction

* Minor spelling corrections
2022-03-21 10:05:20 +05:30
Kyllingene
1889d3e2ea
Clarified use of time_format in docs (#4714)
* Added reference to ``PROMPT_FIELDS`` section in ``time_format`` definition

* Forgot the news item, added now

* Generalized reference to PROMPT_FIELDS
2022-03-15 08:17:16 +05:30
Gil Forsyth
46df765628 Add goat counter to track hits on the docs 2022-03-03 10:45:19 -05:00
dev2718
1aefbf3b35
Fix: detype None env-vars to '' to fix #4600 (#4649)
* detype untyped and path env-vars to ""; path_to_str("") == None

* update env-var-tutorial, add news

* update test_expandvars, test_expand_path, test_register_custom_var_str

* trigger CI-rerun since unrelated osx test failed

Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
2022-01-21 14:46:50 +05:30
Noorhteen Raja NJ
9fbecfc155
feat: use github actions to deploy docs (#4641)
* feat: use github actions to deploy docs

fixes #4473

* fix: install xonsh

* fix: doc action

* chore: support *.md for documentation

* fix: remove hardcoded docs link

it affects local testing

* refactor: move sphinx extensions to its own package

* fix: remove deprecated get_theme_dir

As of Sphinx 1.2, this is passed to Sphinx via a ``setup.py`` entry
point,
and no longer needs to be included in your documentation's
``conf.py``.

* feat: jinja2 render without affecting incremental build

* style:

* feat: auto generate API doc

no need to create a file for each module

* chore: watch top-level and nested files

* refactor: update lib api-docs as well

* fix: import errors when doc generated

for some modules

* fix: relative path

* feat: add release handling

* Update .github/workflows/docs.yml

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>

* refactor: use github-app-token

* chore: deploy docs only when merged

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2022-01-18 11:38:27 -05:00
Noorhteen Raja NJ
c2d25ac251
pre-commit hook for pyupgrade (#4583)
* chore: add pyupgrade

* refactor: upgrade code to py3.7+

ran `pre-commit run pyupgrade -a` while excluding changes to ply

* fix: flake errors
2021-12-06 14:42:26 -05:00
Jason R. Coombs
03ddd829d6
Clarify behavior for capturing and storing output in the history. (#4578)
* Clarify behavior for capturing and storing output in the history. Fixes #4576.

*  Fade to black.
2021-12-02 00:12:42 +05:30
Noorhteen Raja NJ
b2516737b6
code refactor (#4571)
* style:

* refactor: tests of xoreutils
2021-11-30 08:23:32 -05:00