Commit graph

27 commits

Author SHA1 Message Date
Andy Kipp
730fe45627
Added SpecModifierAlias and xthread, xunthread aliases (#5443)
### Motivation

* We have no recommended way to force subprocess command be
(un)threadable
  * #4214
  * #2119
  * #5003
* It's interesting opportunity to have a way to modify specs and CP
using `SpecModifierAlias`.

### Before

```xsh
!(ssh host -T "echo 1")
# output=''  # EXPECTED: 1

__xonsh__.commands_cache.threadable_predictors['ssh'] = lambda *a, **kw: True
!(ssh host -T "echo 1")
```


### After

```xsh
xthread
# Mark command as threadable.

!(xthread ssh host -T "echo 1")
# output='1'
```

Closes:
* Closes #4214
* Closes #2119
* Partially closes #5003

Implementation of `SpecModifierAlias` will help in:
* #2618

JFYI #5413 

## 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>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2024-05-28 11:03:45 -04:00
Noorhteen Raja NJ
15ff663530
Rm xontrib meta (#4790) 2022-05-04 15:02:20 -04:00
omjadas
a49a538ab2
Simplify foreign functions (#4393)
* chore: simplify foreign functions

* fix: sourcing multiple foreign files

* refactor: address review comments

* Update docs/aliases.rst

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

* refactor: run black

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2021-11-23 17:01:42 -05:00
Nate Simon
c4e7843598
add disown command (#4090)
* add "disown" internal command
This command will remove jobs from the shell's job table, allowing the command
to continue running after the shell exits. Configuration options are provided
to manage how suspended background jobs are handled after being disowned.

* job-ctrl-disown code style update

* job-ctrl-disown style updates + change arg --cont to --continue

* Trim extra "=" in doc for "disown" cmd

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

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2021-02-09 10:54:17 -05:00
a
cf0e660783 fix rst 2020-11-25 20:08:24 +03:00
David Dotson
a8d4a57f01
Environment variable registration, deregistration (addresses #3227) (#3377)
* First attempt at register/deregister machinery for envvars

* Added detailed docstring, simplified ensurers

Also added some type checking that became clear from docstring writing.

* Changes in response to @scopatz review

Simplified kwarg names.

* defaultval -> default

* Created new Var namedtuple, as well as DEFAULT_VARS

We should now delete DEFAULT_ENSURERS, DEFAULT_VALUES, DEFAULT_DOCS, and
refactor Env to use the new single namedtuple and the DEFAULT_VARS dict

* Removed DEFAULT_ENSURERS, DEFAULT_VALUES, DEFAULT_DOCS

Now need to edit Env to use new DEFAULT_VARS, Var namedtuple

* Finished updating Env object to use new combined Var

Also made corresponding changes elsewhere ensurer was used

* Working on test failures

* More fixes in light of test failures

* Set default values for Var in register.

There's a bit of duplication here, but makes for a cleaner function.

* Black reformatting on environ.py

* Removed history replay

* Added register tests

* Added addtional deregistration test

* Removed all replay references, in docs too

* Added news item for env-reg-dereg

* trigger rebuild

* doc fix

* more doc fixes

* again

* attr names

* reorder imports

* fix flake error

Co-authored-by: Anthony Scopatz <scopatz@gmail.com>
2020-08-05 10:39:11 -04:00
Jamie Bliss
fc86363d71 Rename xip to xpip 2017-07-25 14:49:54 -04:00
Joel Gerber
12e2fb80cc
Documentation spelling corrections
A number of common spelling typos found within various restructuredText
files have been identified and resolved.
2017-06-07 11:51:06 -04:00
Jamie Bliss
ebddc5c56b Update news & docs. 2017-01-27 22:06:35 -05:00
Gil Forsyth
53595218c3 update path to history_main in docs 2016-12-14 13:42:43 -05:00
laerus
1af12cae80 remove bang aliases 2016-09-28 17:11:09 +03:00
Anthony Scopatz
0f263112aa initial exec 2016-08-13 21:45:19 -04:00
Anthony Scopatz
d14292cb9c some doc fixes 2016-06-18 17:32:37 -04:00
Anthony Scopatz
503b277992 added showcmd alias 2016-05-25 21:38:58 -04:00
Anthony Scopatz
4a6e153396 doc fixes 2016-05-20 17:58:50 -04:00
Morten Enemark Lund
67f569065a Fix typo 2016-05-17 13:46:10 +02:00
Morten Enemark Lund
b47a8da549 Update aliases.rst with deactivate/activate aliases and remove documentation on which->where alias 2016-05-17 13:43:59 +02:00
Anthony Scopatz
dbe93d2e54 more docs 2016-05-11 02:49:03 -04:00
Burak Yigit Kaya
48dac6e9cd New: Add sudo functionality on Windows 2016-03-27 23:12:56 +03:00
Anthony Scopatz
83a93c40a8 alias usage hooks 2016-02-05 01:25:59 -05:00
Anthony Scopatz
46a136c58e initial cmdhelp 2016-02-05 00:42:05 -05:00
Anthony Scopatz
0d3ba14711 implements the source-foreign alias and refactors source-bash 2015-10-31 19:37:07 -04:00
Anthony Scopatz
778d19341b added rc file 2015-09-12 20:27:21 -04:00
Anthony Scopatz
634be98a0f builtin 2015-08-30 10:38:36 -04:00
Anthony Scopatz
4f01d8dddc updated aliases doc 2015-08-30 10:36:14 -04:00
Anthony Scopatz
95c4ba4e84 some more dic updates 2015-08-29 17:00:35 -04:00
Aaron Griffin
e6040d5f3d Added aliases documentation and added information about xexec to it. 2015-04-13 09:03:32 -07:00