Base PS1 Building object.
| Class Variable | USER |
PS1 user expansion value. |
| Class Variable | HOST |
PS1 host expansion value. |
| Class Variable | HOST_LONG |
PS1 host expansion value. |
| Class Variable | WORKING_DIR |
PS1 working directory expansion value. |
| Class Variable | PROMPT |
PS1 prompt for regular user / root user. |
| Class Variable | TERM_BASE |
The basename of the shell's terminal device name. |
| Class Variable | JOBS |
The number of jobs currently managed by the shell. |
| Class Variable | HIST_NUM |
History count. |
| Class Variable | CMD_NUM |
Number of commands this terminal has run. |
| Class Variable | DATE_WEEK_MONTH_DAY |
Date week month day. |
| Class Variable | SHELL_NAME |
The name of the shell, the basename of $0 (the portion following the final slash). |
| Class Variable | TIME_24 |
The time, in 24-hour HH:MM:SS format. |
| Class Variable | TIME_12HR_W_SECOND |
The time, in 12-hour HH:MM:SS format. |
| Class Variable | TIME_12HR_AM_PM |
The time, in 12-hour am/pm format. |
| Class Variable | BASH_VER |
The version of Bash (e.g., 2.00). |
| Class Variable | BASH_VER_RELEASE |
The release of Bash, version + patchlevel (e.g., 2.00.0). |
| Class Variable | WORKING_DIR_BASENAME |
The basename of $PWD. |
| Method | __init__ |
Initialize class. |
| Instance Variable | delim_color |
Delimiter color. |
| Instance Variable | ps1_escape |
Escape non-printable sequences to prevent prompt breakage. |
| Instance Variable | title_color |
Title color. |
| Instance Variable | fancy_lines |
Turn on Fancy lines. |
| Instance Variable | sections |
Sections list. |
| Method | set_no_ps1_escape |
For prompt debugging, set an option to not escape the unicode and non-printable chars. |
| Method | set_title_color |
Set title color. |
| Method | set_no_color |
Set terminal to no color. |
| Instance Variable | no_color |
Disable color from PS1 prompt. |
| Method | set_fancy_lines |
No summary |
| Method | set_delim_color |
Set Delimiter color. |
| Method | set_section_delim |
No summary |
| Instance Variable | delim |
Section delimiter. |
| Method | set_section_color |
Set default section color. |
| Instance Variable | section_color |
Delim and prefix/suffix color. |
| Method | set_prompt_color |
Set prompt color. :: i.e. $ or # depending on user |
| Instance Variable | prompt_color |
PS1 Prompt $/# color. |
| Method | color |
Abstracted color class. |
| Method | build_template |
Build template (if defined in subclass). |
| Method | set_ends |
No summary |
| Instance Variable | section_prefix |
Section prefix. |
| Instance Variable | section_suffix |
Section suffix. |
| Method | add_custom |
Add custom section value/color. |
| Method | add_newline |
Insert newline. |
| Method | add_user_host |
No summary |
| Method | add_working_directory |
No summary |
| Method | add_git_branch |
Add git branch to prompt. |
| Method | add_exit_code |
Add Exit code indicator to prompt. |
| Method | add_user |
Add PS1 user expansion value. |
| Method | add_host |
Add PS1 host expansion value. |
| Method | add_host_long |
Add PS1 host expansion value. |
| Method | add_term_base |
Add The basename of the shell's terminal device name. |
| Method | add_jobs |
Add The number of jobs currently managed by the shell. |
| Method | add_hist_num |
Add History count. |
| Method | add_cmd_num |
Add Number of commands this terminal has run. |
| Method | add_date_week_month_day |
Add Date week month day. :: Mon Sep 13 |
| Method | add_date_time_24hr |
Add the date/time, in 24-hour HH:MM:SS format. :: Mon Sep 13 10:28:40 |
| Method | add_shell_name |
Add The name of the shell, the basename of $0 (the portion following the final slash). |
| Method | add_time_24 |
Add The time, in 24-hour HH:MM:SS format. :: 10:28:40 |
| Method | add_time_12hr_with_second |
Add The time, in 12-hour HH:MM:SS format. :: 10:28:40 |
| Method | add_time_12hr_am_pm |
Add The time, in 12-hour am/pm format. :: 10:28 AM |
| Method | add_bash_ver |
Add The version of Bash (e.g., 2.00). |
| Method | add_bash_ver_release |
Add The release of Bash, version + patchlevel (e.g., 2.00.0). |
| Method | add_working_dir_basename |
Add The basename of $PWD. |
| Method | output |
Output / export PS1 value. |
| Method | _strip_color |
Strip color from output. |
| Method | _sammy |
Sandwhich section between separators. |
The name of the shell, the basename of $0 (the portion following the final slash).
str)
For prompt debugging, set an option to not escape the unicode and non-printable chars.
Set section separator. :
i.e. [section1]-[section2]
^ separator
Abstracted color class.
| Parameters | cval | Undocumented (type: str) |
| txt | Undocumented | |
| escape | Undocumented |
ps1api.Parrot, ps1api.ParrotGitBuild template (if defined in subclass).
Set Section start / end values. :
{}
{section1}-{section2}
[]
[section1]-[section2]
❰❱
❰section1❱-❰section2❱
Add custom section value/color.
| Parameters | value | Undocumented (type: str) |
| color | Undocumented (type: str) | |
| title | Undocumented (type: str) |
Add User/Host to prompt. :
[user@hostname]-[section2]
^ add this
| Parameters | user_color | Undocumented (type: str) |
| at_sym_color | Undocumented (type: str) | |
| host_color | Undocumented (type: str) |
Add Working directory to prompt. :
[user@hostame]─[~/path/i/am/in]
^ add this
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add git branch to prompt.
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add Exit code indicator to prompt.
| Parameters | ok_txt | Undocumented (type: str) |
| err_txt | Undocumented (type: str) | |
| ok_color | Undocumented (type: str) | |
| err_color | Undocumented (type: str) | |
| title | Undocumented (type: str) |
Add PS1 user expansion value.
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add PS1 host expansion value.
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add PS1 host expansion value.
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add The basename of the shell's terminal device name.
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add The number of jobs currently managed by the shell.
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add History count.
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add Number of commands this terminal has run.
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add Date week month day. :
Mon Sep 13
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add the date/time, in 24-hour HH:MM:SS format. :
Mon Sep 13 10:28:40
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add The name of the shell, the basename of $0 (the portion following the final slash).
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add The time, in 24-hour HH:MM:SS format. :
10:28:40
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add The time, in 12-hour HH:MM:SS format. :
10:28:40
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add The time, in 12-hour am/pm format. :
10:28 AM
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add The version of Bash (e.g., 2.00).
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |
Add The release of Bash, version + patchlevel (e.g., 2.00.0).
| Parameters | color | Undocumented (type: str) |
| title | Undocumented (type: str) |