[F] Fix backslashes escape in HyFetch
https://github.com/hykilpikonna/hyfetch/issues/19
This commit is contained in:
@@ -238,7 +238,12 @@ def get_distro_ascii(distro: str | None = None) -> str:
|
||||
os.environ['CUSTOM_DISTRO'] = distro
|
||||
cmd = 'print_custom_ascii'
|
||||
|
||||
return normalize_ascii(run_command(cmd, True))
|
||||
asc = run_command(cmd, True)
|
||||
|
||||
# Unescape backslashes here because backslashes are escaped in neofetch for printf
|
||||
asc = asc.replace('\\\\', '\\')
|
||||
|
||||
return normalize_ascii(asc)
|
||||
|
||||
|
||||
def get_distro_name():
|
||||
@@ -256,6 +261,9 @@ def run_neofetch(preset: ColorProfile, alignment: ColorAlignment):
|
||||
w, h = ascii_size(asc)
|
||||
asc = alignment.recolor_ascii(asc, preset)
|
||||
|
||||
# Escape backslashes here because backslashes are escaped in neofetch for printf
|
||||
asc = asc.replace('\\', '\\\\')
|
||||
|
||||
# Write temp file
|
||||
with TemporaryDirectory() as tmp_dir:
|
||||
tmp_dir = Path(tmp_dir)
|
||||
|
||||
Reference in New Issue
Block a user