Running a portable Cygwin full screen on any machine.

In a previous post, I walked through making a .bat file that helped set up a truly portable Cygwin install. At the end of that post, I mentioned that you can add these lines to the top of the .bat file to specify a starting size for the command window that Windows opens:

REM Set screen dimensions.
mode con: cols=120 lines=40

The issue with this is that if you have a portable install, then you might run from different machines that have very different screen resolutions, so it would be difficult to specify a default number of rows and columns that would work for all situations.

Instead, lets set it up to always run fullscreen!

To do this, I am going to use “mintty” which is a tty console, and is a Windows application. First, install mintty by running the normal Cygwin installer, and choosing mintty from the installable packages. This will make a “mintty.exe” in your cygwin \bin directory.

Next, lets make a new .bat file. I named mine “Run Mintty.bat” and placed it int he root folder of my portable / USB Cygwin drive. I should also mention that I have Cygwin itself installed in the “/cygwin” folder on my drive. If you ahev it installe somewhere else, then you can adjust your paths as needed. From my previous post, mentioned above, I also have a .bat file named “Run Cygwin.bat” that I can run to start Cygwin and map to a specified user, which helps make it truly portable. This isn’t necessary, but I will mention it here anyway.

Now, in our “Run Mintty.bat” file, simple put this line:

start /max cygwin\bin\mintty.exe -w max -t "Mintty Cygwin" -e "./cygwin/bin/bash --login -i"

The “start” keyword just tells Windows to start an application. The .bat file itself will continue and exit, leaving the specified command running.

The “/max” tells Windows to run this application maximized.

cygwin\bin\mintty.exe -w max” s the command we want Windows to execute.

-e ./"cygwin/Run Cygwin.bat"” specifies the command that we want mintty.exe to run on startup.

If you had created a “Run Cygwin.bat” from my previous post about making Cygwin more portable, then you would instead specify “-e ./"cygwin/Run Cygwin.bat"“.

Now to start Cygwin fullscreen, just execute this .bat file.

Tagged with: , , ,
Posted in cygwin
2 comments on “Running a portable Cygwin full screen on any machine.
  1. […] and sometimes from a small netbook, then you won’t be able to get a good default size here. I have another blog post about always getting Cygwin to run fullscreen, on any resolution. Share this:TwitterFacebookLike this:LikeBe the first to like […]

  2. Brian Richer says:

    -w max is all you need (on my win10). It will automatically open fullscreen, and alt-F2 will also auto-fullscreen.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

CodingWithSpike is Jeff Valore. A professional software engineer, focused on JavaScript, Web Development, C# and the Microsoft stack. Jeff is currently a Software Engineer at Virtual Hold Technologies.

I am also a Pluralsight author. Check out my courses!

%d bloggers like this: