xonsh.xonfig

The xonsh configuration (xonfig) utility.

class xonsh.xonfig.XonfigAlias(**kwargs)[source]

Manage xonsh configuration.

exception Error(message: str, errno=1)

Special case, when raised, the traceback will not be shown. Instead the process with exit with error code and message

add_note()

Exception.add_note(note) – add a note to the exception

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
add_command(fn)[source]
build()[source]

Sub-classes should return constructed ArgumentParser

create_parser(func=None, has_args=False, allowed_params=None, **kwargs) ArgParser

create root parser

err(*args, **kwargs)

Write text to error stream

out(*args, **kwargs)

Write text to output stream

write_to(stream: str, *args, **kwargs)
xonsh_complete(command, **kwargs)
property parser
xonsh.xonfig.make_env_wiz()[source]

Makes an environment variable wizard.

xonsh.xonfig.make_envvar(name)[source]

Makes a StoreNonEmpty node for an environment variable.

xonsh.xonfig.make_exit_message()[source]

Creates a message for how to exit the wizard.

xonsh.xonfig.make_fs_wiz()[source]

Makes the foreign shell part of the wizard.

xonsh.xonfig.make_xonfig_wizard(default_file=None, confirm=False, no_wizard_file=None)[source]

Makes a configuration wizard for xonsh config file.

Parameters:
default_filestr, optional

Default filename to save and load to. User will still be prompted.

confirmbool, optional

Confirm that the main part of the wizard should be run.

no_wizard_filestr, optional

Filename for that will flag to future runs that the wizard should not be run again. If None (default), this defaults to default_file.

xonsh.xonfig.make_xontrib(xon_item: tuple[str, Xontrib])[source]

Makes a message and StoreNonEmpty node for a xontrib.

xonsh.xonfig.make_xontribs_wiz()[source]

Makes a xontrib wizard.

xonsh.xonfig.print_welcome_screen()[source]
xonsh.xonfig.xonfig_color_completer(*_, **__)[source]