mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
aurweb.spawn: Support stdout redirections to non-tty
Only ttys have a terminal size. If we can’t obtain it, we’ll just use 80 as a sane default. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
445a991ef1
commit
a1a742b518
1 changed files with 5 additions and 1 deletions
|
@ -87,12 +87,16 @@ def start():
|
|||
return
|
||||
atexit.register(stop)
|
||||
|
||||
try:
|
||||
terminal_width = os.get_terminal_size().columns
|
||||
except OSError:
|
||||
terminal_width = 80
|
||||
print("{ruler}\n"
|
||||
"Spawing PHP and FastAPI, then nginx as a reverse proxy.\n"
|
||||
"Check out {aur_location}\n"
|
||||
"Hit ^C to terminate everything.\n"
|
||||
"{ruler}"
|
||||
.format(ruler=("-" * os.get_terminal_size().columns),
|
||||
.format(ruler=("-" * terminal_width),
|
||||
aur_location=aurweb.config.get('options', 'aur_location')))
|
||||
|
||||
# PHP
|
||||
|
|
Loading…
Add table
Reference in a new issue