I have a small perl script, which is executed in a cygwin terminal and prints out a formatted table. On Default window size, cygwin will insert an line break if the text gets too long and thereby destroy the format of my table. Is there a way from my perl script to set the cygwin window to a bigger size to avoid that kind of problem?
Quick tip: You can also use the Ctrl + Shift , (comma) keyboard shortcut to open the settings page. Click on Startup. Under the “Launch size” section, use the Columns option to adjust the width of the Windows Terminal. Under the “Launch size” section, use the Rows option to adjust the height of the Windows Terminal.
First, find your Cygwin installation path. By default, it is C:\cygwin64 for the 64-bit version. The bash.exe executable in a Cygwin installation should be placed in the bin folder under Cygwin's installation path. Therefore, the absolute path to the executable file is C:\cygwin64\bin\bash.exe by default.
I.e. DOS C: drive can be accessed in Cygwin by /cygdrive/c, D: as /cygdrive/d, etc. To display the contents of the current directory, you can use ls or dir commands.
If you happen to be running this from a shortcut where you could add flags to the mintty
command, you can set the size then. The benefit is that it looks smoother without the twitchy resize.
$ /cygdrive/c/tools/cygwin/bin/mintty.exe --help
Usage: mintty [OPTION]... [ PROGRAM [ARG]... | - ]
Start a new terminal session running the specified program or the user's shell.
If a dash is given instead of a program, invoke the shell as a login shell.
Options:
-c, --config FILE Load specified config file (cf. -C or -o ThemeFile)
-e, --exec ... Treat remaining arguments as the command to execute
-h, --hold never|start|error|always Keep window open after command finishes
-p, --position X,Y Open window at specified coordinates
-p, --position center|left|right|top|bottom Open window at special position
-p, --position @N Open window on monitor N
-s, --size COLS,ROWS Set screen size in characters (also COLSxROWS)
-s, --size maxwidth|maxheight Set max screen size in given dimension
-t, --title TITLE Set window title (default: the invoked command) (cf. -T)
-w, --window normal|min|max|full|hide Set initial window state
-i, --icon FILE[,IX] Load window icon from file, optionally with index
-l, --log FILE|- Log output to file or stdout
--nobidi|--nortl Disable bidi (right-to-left support)
-o, --option OPT=VAL Set/Override config file option with given value
-B, --Border frame|void Use thin/no window border
-R, --Reportpos s|o Report window position (short/long) after exit
--nopin Make this instance not pinnable to taskbar
-D, --daemon Start new instance with Windows shortcut key
-H, --help Display help and exit
-V, --version Print version information and exit
See manual page for further command line options and configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With