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

# xonsh.prompt.job

Prompt formatter for jobs fields e.g. current_job.

class xonsh.prompt.job.CurrentJobField(**kwargs)
  Parameters:
    kwargs

      attributes of the class will be set from this

  classmethod wrap(**kwargs) → tp.Callable[..., FieldType]

    decorator to set the updator

  update(ctx)

    will be called from PromptFields getter for each new prompt

  update_current_cmds(cmds)

    Context manager that updates the information used to update the job name

  property name: str

    will be set during load.

    Notes

    fields with names such as `gitstatus.branch` mean they are defined in a module named `gitstatus` and are most likely a subfield used by `gitstatus`

  prefix = ''
  suffix = ''
  updator: tp.Callable[[FieldType, PromptFields], None] | None = None

    this is a callable that needs to update the value or any of the attribute of the field

  value = ''

    This field should hold the bare value of the field without any color/format strings