Shell segments

class powerline.segments.shell.ShellCwdSegment[source]
powerline.segments.shell.continuation(pl, segment_info, omit_cmdsubst=True, right_align=False, renames={})[source]

Display parser state.

Parameters:
  • omit_cmdsubst (bool) – Do not display cmdsubst parser state if it is the last one.

  • right_align (bool) – Align to the right.

  • renames (dict) – Rename states: {old_name : new_name}. If new_name is None then given state is not displayed.

Highlight groups used: continuation, continuation:current.

powerline.segments.shell.jobnum(pl, segment_info, show_zero=False)[source]

Return the number of jobs.

Parameters:

show_zero (bool) – If False (default) shows nothing if there are no jobs. Otherwise shows zero for no jobs.

powerline.segments.shell.last_pipe_status(pl, segment_info, signal_names=True)[source]

Return last pipe status.

Parameters:

signal_names (bool) – If True (default), translate signal numbers to human-readable names.

Highlight groups used: exit_fail, exit_success

powerline.segments.shell.last_status(pl, segment_info, signal_names=True)[source]

Return last exit code.

Parameters:

signal_names (bool) – If True (default), translate signal numbers to human-readable names.

Highlight groups used: exit_fail

powerline.segments.shell.mode(pl, segment_info, override={'vicmd': 'COMMND', 'viins': 'INSERT'}, default=None)[source]

Return the current mode.

Parameters:
  • override (dict) – dict for overriding mode strings.

  • default (str) – If current mode is equal to this string then this segment will not get displayed. If not specified the value is taken from $POWERLINE_DEFAULT_MODE variable. This variable is set by zsh bindings for any mode that does not start from vi.