Added pretty download UI

Closes #1
This commit is contained in:
2025-11-27 03:11:44 +01:00
parent 229e0c8efd
commit 1e6f7f0ae6
5 changed files with 234 additions and 23 deletions

39
source/lunch/term.d Normal file
View File

@ -0,0 +1,39 @@
module lunch.term;
version (Windows)
{
import core.sys.windows.windows;
}
struct TermSize
{
int width, height;
}
TermSize termSize()
{
version (Windows)
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
int columns, rows;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
return TermSize(
csbi.srWindow.Right - csbi.srWindow.Left + 1,
csbi.srWindow.Bottom - csbi.srWindow.Top + 1,
);
}
return TermSize(80, 25); // Default for windows cmd
}
int termWidth()
{
return termSize().width;
}
int termHeight()
{
return termSize().height;
}