Skip to content

Commit b73c7f1

Browse files
author
David Arnold
authored
Avoid escape codes (numtide#24)
1 parent 288b6ef commit b73c7f1

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

mkDevShell/options.nix

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ let
1515
str
1616
;
1717

18-
# Nix strings only support \t, \r and \n as escape codes, so use JSON to get
19-
# the escape code.
20-
esc = builtins.fromJSON ''"\u001B"'';
21-
ansiOrange = "${esc}[38;5;202m";
22-
ansiReset = "${esc}[0m";
18+
ansiBoldOrange = "$(tput setaf 202)";
19+
ansiReset = "$(tput sgr0)";
2320

2421
commandsToMenu = commands:
2522
let
@@ -104,7 +101,7 @@ in
104101
motd = mkOption {
105102
type = types.str;
106103
default = ''
107-
${ansiOrange}🔨 Welcome to ${config.name}${ansiReset}
104+
${ansiBoldOrange}🔨 Welcome to ${config.name}${ansiReset}
108105
$(devshell-menu)
109106
'';
110107
description = ''

0 commit comments

Comments
 (0)