mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Merge branch 'detectTerminal' of https://github.com/chanceVermilion/lgogdownloader
This commit is contained in:
commit
f93c8ee753
@ -379,9 +379,16 @@ void Util::setFilePermissions(const boost::filesystem::path& path, const boost::
|
||||
|
||||
int Util::getTerminalWidth()
|
||||
{
|
||||
int width;
|
||||
if(isatty(STDOUT_FILENO))
|
||||
{
|
||||
struct winsize w;
|
||||
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
|
||||
return static_cast<int>(w.ws_col);
|
||||
width = static_cast<int>(w.ws_col);
|
||||
}
|
||||
else
|
||||
width = 10000;//Something sufficiently big
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user