Skip to content
Back to top
View this page
Edit this page

# xonsh.xonfig

The xonsh configuration (xonfig) utility.

class xonsh.xonfig.XonfigAlias(**kwargs)

  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(note, /)

      Add a note to the exception

    with_traceback(tb, /)

      Set self.__traceback__ to tb and return self.

    args
  add_command(fn)
  build()

    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()

  Makes an environment variable wizard.

xonsh.xonfig.make_envvar(name)

  Makes a StoreNonEmpty node for an environment variable.

xonsh.xonfig.make_exit_message()

  Creates a message for how to exit the wizard.

xonsh.xonfig.make_fs_wiz()

  Makes the foreign shell part of the wizard.

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

  Makes a configuration wizard for xonsh config file.

  Parameters:
    default_file str, optional

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

    confirm bool, optional

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

    no_wizard_file str, 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])

  Makes a message and StoreNonEmpty node for a xontrib.

xonsh.xonfig.make_xontribs_wiz()

  Makes a xontrib wizard.

xonsh.xonfig.print_welcome_screen()

xonsh.xonfig.xonfig_color_completer(*_, **__)