Skip to content

Commit 1ec5080

Browse files
committed
Use list form for setfont SysCommand calls
1 parent 0ac29d3 commit 1ec5080

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

archinstall/lib/translationhandler.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def _set_font(self, font_name: str | None) -> bool:
7171

7272
target = font_name or _DEFAULT_FONT
7373
try:
74-
SysCommand(f'setfont {target}')
74+
SysCommand(['setfont', target])
7575
return True
7676
except SysCallError as err:
7777
debug(f'Failed to set console font {target}: {err}')
@@ -89,7 +89,7 @@ def save_console_font(self) -> None:
8989
os.close(cmap_fd)
9090
self._font_backup = Path(font_path)
9191
self._cmap_backup = Path(cmap_path)
92-
SysCommand(f'setfont -O {self._font_backup} -om {self._cmap_backup}')
92+
SysCommand(['setfont', '-O', str(self._font_backup), '-om', str(self._cmap_backup)])
9393
except SysCallError as err:
9494
debug(f'Failed to save console font: {err}')
9595
self._font_backup = None
@@ -103,10 +103,13 @@ def restore_console_font(self) -> None:
103103
if self._font_backup is None or not self._font_backup.exists():
104104
return
105105

106-
args = str(self._font_backup)
106+
cmd = ['setfont', str(self._font_backup)]
107107
if self._cmap_backup is not None and self._cmap_backup.exists():
108-
args += f' -m {self._cmap_backup}'
109-
self._set_font(args)
108+
cmd += ['-m', str(self._cmap_backup)]
109+
try:
110+
SysCommand(cmd)
111+
except SysCallError as err:
112+
debug(f'Failed to restore console font: {err}')
110113

111114
self._font_backup.unlink(missing_ok=True)
112115
self._font_backup = None

0 commit comments

Comments
 (0)