Force terminal to the foreground after current command finishes running

Primary tabs

Replies

Putty has options to take certain actions when it receives a BELL character (  $c(7)  ). Can you change your routine to return a BELL when it completes?

Thank you, Marc!

With Kitty there's even a Put Window on Foreground option:

I've tested with

h 10 w $c(7) 

and it works!

Is there anything similar for cterm/iristerm?

Cache Terminal doesn't have a setting similar to Putty.

Windows has methods for finding a specific window that belongs to another app and bringing it to the foreground. You could write a C++ or C# program to do that:

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-se...
https://stackoverflow.com/questions/11512373/findwindow-and-setforegroun...

Or many scripting languages have libraries that use those Windows methods:

https://www.autoitscript.com/forum/topic/113390-bring-application-or-pro...
https://www.programcreek.com/python/example/89828/win32gui.SetForeground...
https://metacpan.org/pod/Win32::GuiTest