I'm testing something and I would like to create a Windows Terminal with bigger dimensions than the current screen. I know it sounds like a stupid idea, but it is what I'm trying to achieve.
I've tried different things like:
HWND console = GetConsoleWindow();
RECT r;
GetWindowRect(console, &r);
MoveWindow(console, r.left, r.top, 100, 3000, TRUE);
And:
DWORD CurrentMode;
GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &CurrentMode);
SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), CurrentMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
fputs("\x1b[8;30;800t", stdout);
I found both methods on different posts. Both methods change the Terminal dimensions, but that dimension can't be bigger than the screen. I have also realized that you can't (or at least, I wasn't able to) manually resize the Windows Terminal to have bigger dimensions that the screen.
It seems like an impossible task, but maybe someone has any idea on how to do it. Thanks for the help.
GetConsoleWindow
very specifically doesn't work for the Windows Terminal like it used to for the vintage console, conhost.exe
. When called in Windows Terminal, it's going to give you back a dummy HWND
, not the actual HWND
of the Terminal window. FWIW, it's generally not recommended to use that API moving forward.
Even with using the \x1b[8;;t
sequence to resize the console, the console very specifically has code to prevent itself from being resized larger than the size of the monitor it's currently on. See: