Is it possible to programmatically, or otherwise, increase the width of the Windows console window? Or do I need to create a wrapper program that looks and acts like the con
Click on the icon on the top left of the console frame (the one that looks like "C:\"), then select Properties . This lets you customize all kinds of stuff. The "layout" tab has the width of the window.
If you're programming C# here's a method that worked for me (from the bottom of this page)
static void setConsoleSize()
{
System.Console.SetWindowPosition(0,0); // sets window position to upper left
System.Console.SetBufferSize(200,300); // make sure buffer is bigger than window
System.Console.SetWindowSize(122,54); //set window size to almost full screen
//width - maxSet(127,57) (width, height)
//System.Console.ResetColor(); //resets fore and background colors to default
} // End setConsoleSize()
Quoted from the post: "My maximum console size that I could use was 127 columns and 57 rows because that's all that my screen resolution will allow. Reset your screen resolution and this will change.
This is just one of those things that you are going to have to play around with in order for you to get it to display as you like. "
Hey have you guys here ever thought of the possibility of launching and running Cygwin from within the windows command prompt/console? This is what I always do. Then you can do anything you want to the look of the console to make it sexy.
trying to get su from within cygwin can be difficult at times, especially when you are attempting to do some heavy crunching with the tools provided. People have tried all sorts of things from sudo SU for windows to what ever...when it can be as simple as passing on the administrator credentials from you the "user" (if you are the admin?) even without weird UAC pop ups. You can do this via a simple batch script. Have a below this of a screen grab of what my Cygwin looks like and this is running from a portable version of Cygwin too! No registry entries and any of that rubbish!
The batch file passes the credentials to bash and then bash changes directory (notice the double quotes are needed to pass this variable to the Cygwin colsole in order for it to work)
@echo off
setlocal enabledelayedexpansion
REM Changing working folder back to current directory
%~d0
CD %~dp0
REM Folder changed
bash --login -i -c "cd {insert_directory_name_here} && exec ./execution-file-here"
cls
exit 1
Note: the brackets like so { } in the above example are NOT included in the batch script. also note that windows CMD window is passing off the string to cygwin to interpret as multiple conditions; cygwin doesn't read the quotes them selves but whats between them. the && is saying change directories and when you do execute the script ./execution-file-here when you get there.
It's a double whammy you can launch a Cygwin or linux like application from within a MS-Windows window and not even type a letter of code or open a console or anything.
I keep this batch file inside of the /Cygwin/bin directory and create a Windows shortcut link on the desktop. Within the shortcut I can stylise the cmd shell window. Even go as far as transparency ;-)
To get all future console windows in a specific size you can create a shortcut to cmd.exe and then set size on the layout-tab of the shortcut properties.
In console properties at the Layout tab you can configure the following:
Screen Buffer Size Width
Window Size Width
The Window Size Width is how many characters per line will be visible. The Screen Buffer Size is the size
of the line. If you set for example the Window Size Width at 100 and the Screen Buffer Size Width at 200, you will need to use the scrollbar to view the whole contents of lines with sizes between 100 and 200. Lines longer than 200 characters will appear in more than one line. This is useful if you have long lines and you want to copy them in a text file.
The same things apply for Windows PowerShell