first
This commit is contained in:
commit
e7a00dcc0e
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
description = "Bash Prompt Builder";
|
||||
|
||||
inputs = { };
|
||||
|
||||
outputs = { self, ... }@inputs: {
|
||||
ESC = "\\033";
|
||||
CSI = "${self.ESC}[";
|
||||
OSC = "${self.ESC}]";
|
||||
BEL = "\\007";
|
||||
|
||||
nonprinting_begin = "\\[";
|
||||
nonprinting_end = "\\]";
|
||||
wrap_nonprinting = text: "${self.nonprinting_begin}${text}${self.nonprinting_end}";
|
||||
|
||||
prompt = "\\$";
|
||||
current_working_directory = "\\w";
|
||||
username = "\\u";
|
||||
hostname_short = "\\h";
|
||||
hostname_long = "\\H";
|
||||
|
||||
ansi_reset = self.wrap_nonprinting "${self.CSI}0m";
|
||||
ansi_color = style: color: self.wrap_nonprinting "${self.CSI}${builtins.toString style};${builtins.toString color}m";
|
||||
ansi_style_normal = 1;
|
||||
ansi_normal_color = color: self.ansi_color self.ansi_style_normal color;
|
||||
ansi_normal_blue = self.ansi_normal_color 34;
|
||||
|
||||
title_bar = title: self.wrap_nonprinting "${self.OSC}0;${title}${self.BEL}";
|
||||
|
||||
build_prompt = color: title_bar_text: prompt_text: "${color}[${self.title_bar title_bar_text}${prompt_text}]${self.prompt}${self.ansi_reset} ";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue