Skip to main content

Bash-like interactive mode extensions for the xonsh shell.

Project description

Bash-like interactive mode extensions for the xonsh shell.

If you like the idea click ⭐ on the repo and tweet.

Installation

To install use pip:

xpip install xontrib-bashisms
# or: xpip install -U git+https://github.com/xonsh/xontrib-bashisms

Usage

xontrib load bashisms

Enables additional limited Bash-like syntax and commands while at the interactive command prompt:

Added Meaning Xonsh alternative
!! Repeat the last command. todo
!^ Get the first argument from the preceding command. todo
!$ Get the last argument from the preceding command. __xonsh__.history[-1, -1]
!* Get all argument from the preceding command. todo
alias Add alias. aliases['ll'] = 'ls -la'
export NAME=Peter Setting an environment variable. $NAME = 'Peter'
shopt -s dotglob Globbing files with * or ** will also match dotfiles, or those "hidden" files. $DOTGLOB = True
complete Show list of completers. completer list
set <-e/+e> Cause a failure after a non-zero return code. $RAISE_SUBPROC_ERROR = True
set <-x/+x> Turns on tracing of source code lines during execution. trace on and $XONSH_TRACE_SUBPROC = True
unset NAME Unsetting/deleting an environment variable. del $NAME

You can find more xonsh snippets in Bash to Xonsh Translation Guide.

Known issues

The xontrib-bashisms appeared in the beginning of xonsh history as part of the default xontribs. It has issues and we recommend to use xontrib-sh instead.

Threading issues

Because of xontrib-bashisms sets THREAD_SUBPROCS=False there are issues around the threading could appear. If you're using bashisms and faced with issues try the same in xonsh --no-rc mode before reporting the issue.

Only interactive mode

The xontrib features are implemented as on_precommand events and these additions do not affect the xonsh language when run as script. That said, you might find them useful if you have strong muscle memory in interactive mode.

Debug

This xontrib may modify user command line input to implement its behavior. To see the modifications as they are applied (in unified diffformat), please set $XONSH_DEBUG to 2 or higher.

See also

Credits

This package was created with xontrib template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xontrib-bashisms-0.0.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

xontrib_bashisms-0.0.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file xontrib-bashisms-0.0.3.tar.gz.

File metadata

  • Download URL: xontrib-bashisms-0.0.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for xontrib-bashisms-0.0.3.tar.gz
Algorithm Hash digest
SHA256 da1984c4b8175c15c1cb42fc367671c1ff04b9df3cb53fa2be8f299557627bd8
MD5 a14c65f7ce84e08f786f1bcfe0325052
BLAKE2b-256 1bd4e86ff239830cd7f0751cb2b4a128d333ea2ed1c5a959ee980522e8cdd7ca

See more details on using hashes here.

File details

Details for the file xontrib_bashisms-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for xontrib_bashisms-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 51cb170024c482c7abca486fa54b7b14c47fb591b1a9a61b8ff646e241480ffe
MD5 295fd52edf6c74fdf10dffe809a46ddf
BLAKE2b-256 b3b9fc5c151b6e5c8787fa4230e339e48500256dffe9df3043bac77d836cddbf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page