Skip to content

Commit b43c555

Browse files
authored
Merge pull request #194 from desultory/dev
use \033 instead of \e for more shell compat
2 parents c0ea9d5 + 7b4a2d1 commit b43c555

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/ugrd/base/base.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "desultory"
2-
__version__ = "6.3.3"
2+
__version__ = "6.4.0"
33

44
from pathlib import Path
55

@@ -251,11 +251,11 @@ def prompt_user(self) -> list[str]:
251251
"if plymouth --ping; then",
252252
' plymouth display-message --text="$prompt"',
253253
"else",
254-
r' printf "\e[1;35m *\e[0m %s\n" "$prompt"',
254+
r' printf "\033[1;35m *\033[0m %s\n" "$prompt"',
255255
"fi",
256256
]
257257
else:
258-
output += [r'printf "\e[1;35m *\e[0m %s\n" "$prompt"']
258+
output += [r'printf "\033[1;35m *\033[0m %s\n" "$prompt"']
259259
output += [
260260
'wait_enter "$2"',
261261
'return "$?"',
@@ -307,7 +307,7 @@ def edebug(self) -> str:
307307
if [ "$(readvar debug)" != "1" ]; then
308308
return
309309
fi
310-
printf "\e[1;34m *\e[0m %s\n" "${*}"
310+
printf "\033[1;34m *\033[0m %s\n" "${*}"
311311
"""
312312

313313

@@ -323,7 +323,7 @@ def einfo(self) -> list[str]:
323323
else:
324324
output = []
325325

326-
output += ["if check_var quiet; then", " return", "fi", r'printf "\e[1;32m *\e[0m %s\n" "${*}"']
326+
output += ["if check_var quiet; then", " return", "fi", r'printf "\033[1;32m *\033[0m %s\n" "${*}"']
327327
return output
328328

329329

@@ -345,7 +345,7 @@ def ewarn(self) -> list[str]:
345345
"if check_var quiet; then",
346346
" return",
347347
"fi",
348-
r'printf "\e[1;33m *\e[0m %s\n" "${*}"',
348+
r'printf "\033[1;33m *\033[0m %s\n" "${*}"',
349349
]
350350
return output
351351

@@ -358,7 +358,7 @@ def eerror(self) -> str:
358358
plymouth display-message --text="Error: ${*}"
359359
return
360360
fi
361-
printf "\e[1;31m *\e[0m %s\n" "${*}"
361+
printf "\033[1;31m *\033[0m %s\n" "${*}"
362362
"""
363363
else:
364-
return r'printf "\e[1;31m *\e[0m %s\n" "${*}"'
364+
return r'printf "\033[1;31m *\033[0m %s\n" "${*}"'

0 commit comments

Comments
 (0)