Saravanan666/pypi-org huggingface dataset:
Package: xontrib-powerline2
Xontrib Powerline 2xontrib-powerline fork bysantagada/xontrib-powerline.Installpip install xontrib-powerline2And them load it on your.xonshrcxontrib load powerline2ConfigurationThere are two variables that can be set,$PL_PROMPTfor main prompt,$PL_PROMPTfor the right prompt and$PL_TOOLBARfor the bottom toolbar.
They contain a list of sections that can be used separated by>. The value!means not to use that prompt.Examples:$PL_PROMPT='cwd>branch'
$PL_RPROMPT = '!'  # for no toolbar
$PL_TOOLBAR = 'who>virtualenv>branch>cwd>full_proc'
xontrib load powerline2Bulid promptIf you want to override the settings afterxontrib load, so commit changes to your prompt executepl_build_promptcommand.Check configTo see all available sections typepl_available_sectionscommand.Default sectionssectiondescriptionwho{user}@{hostname}virtualenv{env_name}branch{curr_branch}cwd$pwd using $pl_colors['cwd', 'git_root', 'git_sub_dir'] and $pl_partsshort_cwd{short_cwd}full_procrun time of the previous command from historytimingdiff from previous command's executed timetimestrftime(' %h:%m ')historylen(__xonsh__.history)rtns'!' if __xonsh__.history.rtns else nonefull_rtnsrtns[-1] if __xonsh__.history.rtns else noneIf you want to know about{}sections, please lookxonsh document.Custom sectionsWe can add customize origin section by$PL_EXTRA_SEC.# func return [format string, text color, background color]
$PL_EXTRA_SEC = {"user": lambda: [' I'm {user} ', 'BLACK', '#fd971f']}
$PL_PROMPT='user>cwd>branch'
$PL_TOOLBAR='!'
$PL_RPROMPT='!'
xontrib load powerline2Section's colorWe can change section color by$PL_COLORS.$PL_COLORSisdict. Basically, the value is(text_color, background_color).keydefault valuedescriptionwho("BLACK", "#a6e22e")-venv("BLACK", "INTENSE_GREEN")-branch("#333")background color from $PROMPT_FIELDS['branch_bg_color']cwd("WHITE", "#444")-git_root("BLACK", "#00adee")used by cwdgit_sub_dir("WHITE", "#00adee")used by cwdshort_cwd("WHITE", "#444")-full_proc("WHITE", "RED", "#444")There are two types of background depending on the situationtiming("WHITE", "#444")-time("BLACK", "#00adee")-history("WHITE", "#333333")-rtns("WHITE", "RED")-full_rtns("WHITE", "RED", "#444")There are two types of background depending on the situationMulti line promptWe can use multi line prompt by\n.$PL_PROMPT='\nuser>mode>\ncwd'Separate modeWe can change the way of separation mode by$PL_SEP_MODE.modeseparate charpowerline, , , round, , , down, , , up, , , flame, , , squares, , , ruiny, , , lego, For example# set $PL_SEP_MODE or using pl_set_mode alias
$PL_SEP_MODE='round'
pl_set_mode roundIf you want to use original separeter, you can use$PL_ORG_SEP,$PL_ORG_SEP_THIN,$PL_ORG_RSEP.$PL_ORG_SEP = '■'
$PL_ORG_SEP_THIN = '□'
$PL_ORG_RSEP = '■'
xontrib load powerline2Creditslaerus/cookiecutter-xontrib:https://github.com/laerus/cookiecutter-xontribsantagada/xontrib-powerline:https://github.com/santagada/xontrib-powerlineSimiler Projectsjnoortheen/xontrib-powerline3:https://github.com/jnoortheen/xontrib-powerline3That is also compatible withASYNC_PROMPT!
Package: xontrib-powerline3
Powerline3Yet another powerline like prompt for xonsh with async prompt support.Why another one?It uses$PROMPT_FIELDSand no need to have a separate functions and renderer.
Since the addition of$PROMPT_TOKENS_FORMATTERit is possible to use the existing
set of functions to emulate powerline theme for xonsh prompts.Async prompt mode works as well.InstallationTo install use pip:xpipinstallxontrib-powerline3# or: xpip install -U git+https://github.com/jnoortheen/xontrib-powerline3Usagexontrib load powerline3 prompt_ret_code

# the foreground/background colors of the prompt-fields can be configured as below. 
# This works for custom fields as well
# The format is `<prompt-field-name>__pl_colors`. It can be a function returning `tuple[str, str]`
# or set tuples directly as below.
$PROMPT_FIELDS["cwd__pl_colors"] = ("WHITE", "CYAN")

# choose the powerline glyph used
$POWERLINE_MODE = "powerline" # if not set then it will choose random
# available modes: round/down/up/flame/squares/ruiny/lego

# define the prompts using the format style and you are good to go
$PROMPT = "".join(
    [
        "{vte_new_tab_cwd}",
        "{cwd:{}}",
        "{gitstatus:{}}",
        "{ret_code}",
        "{background_jobs}",
        os.linesep,
        "{full_env_name: 🐍{}}",
        "$",
    ]
)
$RIGHT_PROMPT = "".join(
    (
        "{long_cmd_duration: ⌛{}}",
        "{user: 🤖{}}",
        "{hostname: 🖥{}}",
        "{localtime: 🕰{}}",
    )
)Extra PROMPT_FIELDS1.full_env_nameWhen theenv_nameis.venvshow the name of the parent foldercontains-py3.*(when it is poetry created) shows the project name part alone2.background_jobsshow number of running background jobsExamplesCreditsThis package was created withxontrib cookiecutter template.https://www.nerdfonts.com/cheat-sheet?set=nf-ple-https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10kSimilar Projectshttps://github.com/vaaaaanquish/xontrib-powerline2https://github.com/santagada/xontrib-powerline
Package: xontrib-powerline-binding
Xontrib-powerline-bindingPowerlinebinding forxonsh, so you can use your existingpowerlineprompt inxonsh.InstallInstall using pippip install xontrib-powerline-bindingAdd to your.xonshrc:xontrib load powerline_bindingUsageUsespowerlineto setup you$PROMPTand$RIGHT_PROMPT.ConfigurationAddxonsh(and optionallyxonshtoolbar) section to yourpowerlineconfig.json:{
  "ext": {
    "xonsh": {
      "theme": "mytheme"
    },
    "xonshtoolbar": {
      "theme": "mytheme"
    }
  }
}Then createthemes/xonsh/mytheme.json(andthemes/xonshtoolbar/mytheme.json) with your theme configuration (seePowerline documentation).
You can find my example powerline configuration in theexample-powerline-configfolder.Extra segmentsCurrently includes the following xonsh specific powerline segments:powerline_xonsh.exec_timeExecution time of the last command.Highlight group used:exec_time
Package: xontrib-powerline-refined
Powerline for Xonsh shell.InstallTo install this xontrib first download and install the python package:pip3installxontrib-powerlineAnd them load it on your.xonshrcxontribloadpowerlineConfigurationThere are two variables that can be set,PL_PROMPTfor the right prompt andPL_TOOLBARfor the bottom toolbar.
They contain a list of sections that can be used separated by>. The value!means not to use that prompt.Examples:$PL_TOOLBAR='who>virtualenv>branch>cwd>full_proc'$PL_TOOLBAR='!'# for no toolbarTo see all available sections typepl_available_sections, and to commit changes to your prompt executepl_build_prompt.More Inforead more on thexontrib docsand if you want to create your own on
thexontrib tutorialCreditsThis package was created by Leonardo Santagada withCookiecutterand thelaerus/cookiecutter-xontribproject template.The font being used on the screenshot is the incredible3270 fontwith injected characters fromnerd fonts.
Package: xontrib-prompt-starship
Starshipcross-shell prompt in xonsh shell.If you like the idea click ⭐ on the repo andtweet.Additional features:You can split the prompt to left, right and bottom parts.InstallationTo install use pip:# You already have Starship installed. Then:xpipinstallxontrib-prompt-starship# or: xpip install -U git+https://github.com/anki-code/xontrib-prompt-starshipUsagexontribloadprompt_starshipRecommendationWe suggest to use@character to remember aboutyou're using xonsh syntaxand to potentially spread the word about xonsh if you make a screenshot or show your terminal to friends or collegues. Add this to your~/.config/starship.toml:[character]success_symbol="[@](bold green)"error_symbol="[@](bold red)"If you're using Starship for both for another shell and for xonsh and you want to have different characters you can just put the lines above to the new~/.config/starship_xonsh.tomlfile. Then you should add to the~/.xonshrc:$STARSHIP_CONFIG='~/.config/starship_xonsh.toml'xontribloadprompt_starshipConfigurationYou can set the different starship configs for left, right and bottom parts of prompt when your shell type is prompt-toolkit:$XONTRIB_PROMPT_STARSHIP_LEFT_CONFIG="~/.config/starship_xonsh_left.toml"$XONTRIB_PROMPT_STARSHIP_RIGHT_CONFIG="~/.config/starship_xonsh_right.toml"$XONTRIB_PROMPT_STARSHIP_BOTTOM_CONFIG="~/.config/starship_xonsh_bottom.toml"xontribloadprompt_starshipIn case ofusing starship as part of another promptyou can add starship prompt to$PROMPT_FIELDSwithout replacing the current prompt:$XONTRIB_PROMPT_STARSHIP_REPLACE_PROMPT=Falsexontribloadprompt_starshipprint($PROMPT_FIELDS['starship_left']())Result:Known issuesPrompt toolkit issue: the right prompt at the bottom.The using of bottom toolbar is not properly tested and adopted to cute appearance.CreditsThe xontrib-prompt-starship can be used as part ofxontrib-prompt-bar.This package is the part ofergopack- the pack of ergonomic xontribs.This package was created withxontrib cookiecutter template.Adding support for xonsh inside Starship
Package: xontrib-pyrtn
Store the python return value of commands for the session.If you like the idea click ⭐ on the repo andtweet.InstallationTo install use pip:xpipinstallxontrib-pyrtn# or: xpip install -U git+https://github.com/dyuri/xontrib-pyrtnUsagexontribloadxontrib_pyrtnThe xontrib adds two functions to the global namespace -In[]andOut[]. They are similar toipython'sIn[]andOut[].
(In()andOut()is also available and does the same thing, except they can be called w/o argument and will show the list of input/output.)A newPROMPT_FIELDpyhistnumis also added, to be able to include the number of the upcoming command (like inipython).Example$xontribloadpyrtn
$$PROMPT="[{pyhistnum}]$"[2]$[12*3+6][42][3]$In[2]"[12 * 3 + 6]\n"[4]$Out[2]+[1][42,1][5]$CreditsThis package was created withxontrib cookiecutter template.
Package: xontrib-readable-traceback
xontrib-readable-tracebackMake traceback easier to see for xonsh.Python work very often with large libraries like pandas, or matplotlib. This means that exceptions often produce long stack traces. Since we don't need to see the library detail in the vast majority of cases. Especially with a shell like xonsh.This xontrib making readable and short traceback.example:
Simple division by zero error.example:
This simple pandas error produces a stacktrace containing 28 lines. But xontrib load...InstallInstall using pippip install xontrib-readable-tracebackWrite .xonshrcxontrib load readable-tracebackUsageThis xontrib usebacktrace package.For the main usage, please refer to the following.https://github.com/nir0s/backtrace#usageExample xonshrcxonshrc sample.~~~
xontrib load readable-traceback
$READABLE_TRACE_STRIP_PATH_ENV=True
$READABLE_TRACE_REVERSE=True
~~~Setting backtraceThe correspondence with the variable ofbacktraceis as follows.backtracexontrib-readable-tracebackTypereverse$READABLE_TRACE_REVERSEboolalign$READABLE_TRACE_ALIGNboolstrip_path$READABLE_TRACE_STRIP_PATH_ENVboolenable_on_envvar_only$READABLE_TRACE_ENVVAR_ONLYboolon_tty$READABLE_TRACE_ON_TTYboolconservative$READABLE_TRACE_CONSERVATIVEboolstyle$READABLE_TRACE_STYLESdictFor details ofstyleplease refer tobacktrace#styleandcolorama.Switching readable-tracebackIf we want to turn trace off, we can use:$XONSH_READABLE_TRACEBACK=FalseIf so, the notation of traceback follows xonsh_env($XONSH_SHOW_TRACEBACK).Xonsh traceback logXonsh can keep a log of traceback.To keep the log, write"ABSOLUTE PATH TO TRACEBACK LOG"below.$XONSH_TRACEBACK_LOGFILE="PATH"If it is None, no log is kept.
Default is None.ThanksThankshttps://github.com/xonsh/xonshhttps://github.com/nir0s/backtracehttps://github.com/laerus/cookiecutter-xontribI appreciate all Python's assets and xonsh.If there is something problem, up to github issue.@vaaaaanquish
Package: xontrib-rtx
Initializertx(polyglot asdf-like runtime manager in Rust)in a more performant and flexible wayIf you like the idea click ⭐ on the repo andtweet.This xontrib adds a couple of (maybe too tiny to notice) improvements:(no cost) replaces the subprocess syntax for the hook rtx function with a pure python syntax, which for some reason improves hook runtime by~60%(but in absolute terms maybe just a dozen or twoms)(less convenient) replaces a hook on every prompt paint with hooks onshell launchchanging dirsempty commandsuseful to refresh shell status when you edit.tool-versionsoutsideof shell (optional)commands that containt custom text chunksuseful to refresh shell status when you edit.tool-versionsina shell (optional)InstallationTo install use pip:xpipinstallxontrib-rtx# or: xpip install -U git+https://github.com/eugenesvk/xontrib-rtxUsageThis xontrib requiresrtxto be inPATHor~/bin; or if it's added toPATHvia another xontrib (e.g, you installed it via Homebrew and usexontrib-homebrew), then you should load this xontrib after the one settingPATHAdd the following to your.pyxontrib loading config andimportit in your xonsh run control file (~/.xonshrcor~/.config/rc.xsh):fromxonsh.xontribsimportxontribs_loadfromxonsh.built_insimportXSHenvx=XSH.envxontribs=["rtx",# Initializes rtx (polyglot asdf-like runtime manager)# your other xontribs]# ↓ optional configuration variablesif'rtx'inxontribs:# Configure rtx only if you're actually loading# config var                       	  value             	  |default|alt_cmd¦ commentenvx['XONTRIB_RTX_CHUNK_LIST']=['.tool-versions']# |['.tool-versions']|False¦ (feeble attempts to track edits to `.tool-versions` in the command line) update rtx status if command contains any of the string chunks in this list; False to disable this listener completelyenvx['XONTRIB_RTX_NEWLINE_REFRESH']=True# |True|False¦ update rtx status if command is empty (e.g, ⏎ on a blank line to refresh after editing `.tool-versions` in a text editor); False to disable this listener completelyenvx['XONTRIB_RTX_FORCE_COLOR']=True# |True|False¦ preserve colored rtx outputenvx['XONTRIB_RTX_LOGLEVEL']=1# |1|0¦ print xontrib log messages: 0 none, 1 error; 'rtx' stderr is always passed throughxontribs_load(xontribs_manual)# actually load all xontribs in the listOr just add this to your xonsh run control filexontrib load rtx # Initializes rtx (polyglot asdf-like runtime manager)
# configure like in the example above, but replace envx['VAR'] with $VAR
$XONTRIB_RTX_LOGLEVEL = 1Known issuesIn the future xontrib-rtx will be autoloaded, but this is currently blocked due to axonsh bug: too early autoload prevens reading user config; also, autoloading can't be disabledCreditsThis package was created withxontrib template
Package: xontrib-sh
Paste and run commands from bash, fish, zsh, tcsh inxonsh shell.If you like the idea click ⭐ on the repo and stay tuned.Installxpipinstall-Uxontrib-shecho'xontrib load sh'>>~/.xonshrc# Reload xonshUsageStart the line with!(exclamation mark with space) then paste the sh-compatible commands after it and run.
The commands syntax will be tested in the shells from list (if installed) and the commands will be run in
the first matching shell. By default list of shells contains bash and sh.The commands will be executed in the environment that will be inherited from current but if the commands modify
the environment there will no changes in source xonsh environment.To set the list of shells use environment variable before loading the xontrib:$XONTRIB_SH_SHELLS=['bash','sh']# defaultxontribloadsh!echohelloAlso you can set the shell explicitly i.e.!bashor!b(the first letter of the shell).The main use caseThe main use case ofxontrib-shis when you copy and paste the sh-commands from some article or instruction
and this commands are environment agnostic and you want to run it without rewriting it on xonsh or run sh-shell.For example you've found snippet of bash commands that check existing ofcurl:TMP=/tmp&&cd$TMP&&([[-x$(command-vcurl)]]&&echo"Yes"||echo"No")You hesitate how xonsh will execute this and you're absolutely right there will be syntax error.
To run this just start with!or!bor!bashand paste the commands. As result you'll see the right message.ExamplesBash brace expansion!echo01.{05..10}# Or explicitly:!becho01.{05..10}!bashecho01.{05..10}bash:
01.05 01.06 01.07 01.08 01.09 01.10Multiline loop!foriin123doecho$idonebash:
1
2
3Use environment variables to pass values from xonsh to sh$ENV='hello'!echo$ENV!bash:
hello!Known issuesDetermining the shell on short commandIn case of usage many different shells the detection of the shell works perfect when the commands contain shell-specific syntax.
But if you run the short command that could be valid in all shells the first matched shell will be chosen but it's could be wrong.For example you have bash and fish in the list of shells. The short fish command may be determined as bash command.
As result the command will be failed:$XONTRIB_SH_SHELLS=['bash','fish']xontribloadsh# Run fish command:!set-Uvar1value1# bash: line 0: set: -U: invalid optionTo avoid this use the explicit setting the shell i.e.!fish set -U var1 value1.Also, sincepwshandcmdshells don't have an option to detect their own syntax, they can only be invoked:explicitly by their name, i.e.!por!pwshimplicitly via the!prefix only when there isoneshell in$XONTRIB_SH_SHELLSWhy it's better thanxonsh subprocess macros?Xonsh subprocess macros is not supporting multiline commands and require more keystrokes.Additional options$XONTRIB_SH_USEFULL(defaultTrue) - enables to set the shell explicitly by the name of the shell i.e.!bash.$XONTRIB_SH_USEFIRST(defaultTrue) - enables to set the shell explicitly by the first letter i.e.!binstead of!bash.LinksThis package is the part ofergopack- the pack of ergonomic xontribs.This package was created withxontrib cookiecutter template.
Package: xontrib-shadowenv
An Xonsh integration for shadowenvIf you like the idea click ⭐ on the repo andtweet.InstallationRequiresshadowenvto be installed and available in your PATH.To install use pip:xpipinstallxontrib-shadowenv# or: xpip install -U git+https://github.com/zscholl/xontrib-shadowenvUsagexontribloadshadowenvCreditsThis package was created withxontrib template.
Package: xontrib-simplejump
simplejumpOverviewThe simplest way to jump between directories.Installationpipinstallxontrib-simplejumpMotivationI wanted a simple and efficient alternative to z, fasd and other jump scripts.simplejump algorithm:on directory change: associate the base name to the full path of a dir in simplejump dicton user search: return the exact match or the smaller partial match from simplejump dicton tabcomplete: return the list of simplejump dict keys that match the command prefixon shell init:  load the dict from simplejump file or an empty dicton shell exit: store the dict in simplejump file using json formatsimplejump design:keys/names are case insensitive, values/paths are case sensitivesimplejump vars:simplejump file: $SIMPLEJUMP_FILEsimplejump dict: $SIMPLEJUMP_DICTsimplejump file:simplejump file: ~/.simplejumpExamplesimplejump[DIR]
Package: xontrib-ssh-agent
Xontrib-ssh-agentSsh-agent xonsh integration.InstallInstall using pippip install xontrib-ssh-agentAdd to your.xonshrc:xontrib load ssh_agentUsageThis xontrib launchesssh-agentwhenxonshis started if it isn't already running, and sets the required environment variables.By issuing thesshcommand it checks for added identities, and if there's none it adds them via thessh-addcommand.gitsupportTo handle ssh identities,repasshis used under the hood. If it's on the$PATH,xontrib-ssh-agentsets$GIT_SSHto it by default. If yourrepasshcommand is not on the$PATHby default, but you still want to use it for git, then set$GIT_SSHto it manually, or set$REPASSH_COMMANDbefore you load this xontrib.
Package: xontrib-syslog-shell-profiler
A Xonsh plugin to profile and log command execution to a syslog file.InstallationUsing pip:pip install xontrib-syslog-shell-profilerUsagexontribloadsyslog-shell-profilerIt will define$XONSH_HISTORY_BACKEND = JsonSyslogHistory, if you overwrite this variable the syslog backend will not work. This history backend used the default JSON one as base and any change on that class will affect to the plugin.
Package: xontrib-termcolors
Set terminal colors based on selected xonsh theme.If you like the idea click ⭐ on the repo andtweet.InstallationTo install use pip:xpipinstallxontrib-termcolors# or: xpip install -U git+https://github.com/dyuri/xontrib-termcolorsUsageThis xontrib sets the colors of your (xterm compatible) terminal based on your xonsh theme.$xontribloadtermcolorsIf you change your theme and want to update the terminal colors use thetermcolorscommand:$$XONSH_COLOR_STYLE="monokai"$termcolorsColorsThe main 16 colors will be used directly from the pygments/ptk theme. The following special colors can be set by adding the tokens to your theme:Token.Terminal.Foreground- foreground colorToken.Terminal.Background- background colorToken.Terminal.Curson- cursor colorExampleTo replace all colors in xonsh and terminal to green add this to your.xonshrc:fromxonsh.toolsimportregister_custom_stylefromxonshimportstyle_toolsfrompygments.tokenimportTokenmystyle={k:'#00ff00'fork,cinstyle_tools.DEFAULT_STYLE_DICT.items()}mystyle[Token.Terminal.Foreground]='#00ff00'mystyle[Token.Terminal.Curson]='#00ff00'mystyle[Token.Terminal.Background]='#000000'register_custom_style("green",mystyle,base=__xonsh__.env['XONSH_COLOR_STYLE'])$XONSH_COLOR_STYLE="green"xontribloadtermcolorsCreditsThis package was created withxontrib cookiecutter template.
Package: xontrib-term-integrations
Terminal Emulators integrationShell integrationfor Xonsh.The following terminal emulators are supportediTerm2kittyWezTermwith CWD; Input, Output, and Prompt zones; and User Vars for tracking additional shell stateNote: If identifying current terminal fails,iTerm2hooks are loaded.PRs welcome on improving the support to more terminal programs :)InstallationTo install use pip:xpipinstallxontrib-term-integrations# or: xpip install -U git+https://github.com/jnoortheen/xontrib-term-integrationsUsage# this modifies the $PROMPT function. So load it after setting $PROMPT if you have a custom valuexontribloadterm_integrationContributingPlease make sure that youDocument the purpose of functions and classes.When adding a new feature, please mention it in theREADME.md. Use screenshots when applicable.Conventional Commitstyle should be used
for commit messages as it is used to generate changelog.Please usepre-committo run qa checks. Configure it withpre-commitinstall-hooks
Package: xontrib-up
UP! - the fast way to go up directories in xonshTired of attaching "balloons" to yourcdcommand to go up directories?cd ..,cd ../..,cd ../../..,cd ../../../..,cd ../../../../../../../../../../../../../..?Tired of creating weird aliases likecd..4,cd..12, ...cd..100to navigate up directories?Now you can useup!Typeupto go up one directory. Typeup 2to go up two directories. Typeup 42to go up forty-two directories. It's that easy.No more defining an alias forcd ../../../../../../...  Just typeup 7.$# cd ../../..$up3You can also get the path thatupwill produce by usingupp(up path).
This lets you see what directory up will produce.$# pushd -q .; cd ../../../..; echo $PWD; popd -q$upp4Listing ancestor directories withlsrequires balloons, but not anymore.
A simple way to list ancestor dirs is withlsup, which forwards on any options tols.$# long list everything 3 dirs up (ie: `ls -opts ../../..`)$lsup-laFGh3CommandsCommandDescriptionupTravel up any number of directoriesuppGet the path of an ancestor directorylsupList the contents of an ancestor directoryInstallInstall from PyPI viaxpip:xpipinstallxontrib-up# or: xpip install -U git+https://github.com/mattmc3/xontrib-upThen, add this to your~/.config/xonsh/rc.xshor~/.xonshrc:xontribloadup