OMNeT mingwenv in the Windows Terminal

590 views
Skip to first unread message

Timo Haeckel

unread,
Dec 17, 2021, 6:34:41 AM12/17/21
to OMNeT++ Users
I have created a new mingewnv.cmd that allows you to launch the environment console from the new windows terminal. Maybe, this is of interest to others, so I thought I just share it here. 
10e8a8a7-031e-4c80-94a1-51bc50f3829a.jpg
Create a new .cmd (e.g., terminalenv.cmd) inside your OMNET root directory (e.g., /c/omnet/omnet-v5.6.2/) next to the default mingwenv.cmd and insert the following commands:
@echo off
setlocal
set HOME=%~dp0
call "%HOME%\tools\win64\msys2_shell.cmd" -mingw64 -defterm -here -no-start

They call the packaged msys environment shipped with omnet with specific parameters to directly launch it in a windows terminal windows. The HOME environment variable allows to run OMNET commands directly.
Test if everything works by launching the cmd, which should open a Windows Terminal with the msys environment, and try launching omnetpp, for example. 

You can also create a profile in the terminal that allows you to launch omnetpp env from an open windows terminal window. Add a new profile in the terminal settings and enter the termianlenv.cmd as command line call (e.g., C:\omnet\omnetpp-5.5.1\terminalenv.cmd). Here, you can also set a launch directory, e.g., to your omnet workspace.

I have tested it with OMNeT++ Version 5.5.1 and 5.6.2.

Hope this helps someone who tries the same :-) Maybe, something like this could be shipped with Omnet for Windows in the next releases. 

Rudolf Hornig

unread,
Dec 20, 2021, 6:52:26 AM12/20/21
to OMNeT++ Users
Thanks for sharing. As MS is moving towards having the Terminal as the default console app in Windows, this will be default behavior sooner or later. I will take a look and see whether mingwenv could be modified to start in Terminal by default (if the terminal app is installed).

Also if you are running on Windows 11, GUI apps are flawlessly working in the Linux subsystem and it is recommended to run the Linux version of OMNET in the Linux subsystem instead of the native windows versions. As strange as it sound, it will be a LOT faster than running the native Windows/MinGW version.

Reply all
Reply to author
Forward
0 new messages