suzdraws / mintty

Automatically exported from code.google.com/p/mintty
0 stars 0 forks source link

Option for setting window class name #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I would like to be able to change the name of the window class used by 
mintty. Maybe by a command line parameter? This can make different instances 
of mintty distinguishable from each other by tools like autohotkey.

Original issue reported on code.google.com by dannydu...@gmail.com on 18 Jan 2010 at 8:37

GoogleCodeExporter commented 9 years ago
Surely AHK must have other ways of distinguishing different windows of the same
application, since I very much doubt that there are many apps out there that 
allow to
set the window class name?

Original comment by andy.koppe on 19 Jan 2010 at 7:04

GoogleCodeExporter commented 9 years ago
title or class name, and title is dynamic in terminals.

most windows programs however are not run over and over, unlike in unix. for 
X11 
programs, they almost always have way to set classname (or at least used to 
long ago) 
from cmdline. 

Original comment by dannydu...@gmail.com on 19 Jan 2010 at 7:53

GoogleCodeExporter commented 9 years ago
What about process number? Each mintty is a different process, so the windows 
should
be distinguishable by that. And from
http://www.autohotkey.com/docs/commands/WinGet.htm: To use a process identifier
(PID), specify ahk_pid %VarContainingPID%.

Original comment by andy.koppe on 20 Jan 2010 at 6:59

GoogleCodeExporter commented 9 years ago
yes, but then you have to store pid in file somewhere and then have ahk read 
the file.. 
ugh... quite annoying in windows.

i have a fork of mintty right now that has the feature, but i did it very 
poorly. if 
you want, i can clean it up and submit a patch

Original comment by dannydu...@gmail.com on 20 Jan 2010 at 1:55

GoogleCodeExporter commented 9 years ago
also note that on win7, selectable class name has the added benefit of being 
able to 
control grouping on the taskbar

Original comment by dannydu...@gmail.com on 20 Jan 2010 at 1:56

GoogleCodeExporter commented 9 years ago
Don't worry about providing a patch; it's not implementation difficulty I'm 
concerned
about here, but option inflation. You're making a good case for a --class 
option, but
I'm still not entirely convinced.

Could you describe a small use case for what this could be used for? And if you 
don't
have some sort of dynamic name allocation similar in complexity to the PID 
scheme,
wouldn't you be limited to a fixed number of windows?

Original comment by andy.koppe on 20 Jan 2010 at 7:35

GoogleCodeExporter commented 9 years ago
so i work on a system that has me coding in a huge mintty, and a bunch of 
smaller 
windows for starting up background support processes. each spit out logs on 
console.

i have a laptop + a 30" monitor. now, normally i only have 4 of these windows 
(1 
major + 3 minor), so id like to do --class=winmajor, --class=winminor1, --
class=winminor2, etc..

then i have autohotkey stuff that detects when i dock to my 30".. and when i 
do, it 
moves my windows and resizes them to fit the 2560x1600 30" nicely, and when i 
disconnect, windows7 moves them all over the laptops 1920x1080 in a very lame 
way, so 
autohotkey fixes them up for the laptop's resolution. i don't have an issue 
with my 
webbrowser, IM window, etc..., because they all have unique names. the only 
windows 
on my desktop that have the same class are minttys. the title of the mintty is 
useless because its set to the machine + currentdir of where my shell is logged 
into 
(local or remote via ssh) and changes all over the place.

really, the issue here is that in all gui systems, there are 2 ways to identify 
a 
window, title and class. you can use pid sorta, assuming the pid only has 1 
window, 
and assuming that you have the pid from someplace.

i could do something where i start the mintty processes from someplace, write 
the pid 
to a file, and then use that file to get the value for ahk_pid, but thats such 
a pain 
in the ass in windows for something that could be easily solved with --class.

cygwin + windows was ok, but mintty as a xterm replacement (instead of crashy 
native 
rxvt) and autohotkey replicating many features of x11 window manager has 
totally made 
the environment awesome.

Original comment by dannydu...@gmail.com on 20 Jan 2010 at 8:00

GoogleCodeExporter commented 9 years ago

Original comment by andy.koppe on 20 Jan 2010 at 8:40

GoogleCodeExporter commented 9 years ago
Implemented in r706 on trunk. Please give it a try. Unfortunately I find that
different class names are not grouped separately in the Win7 taskbar.

Original comment by andy.koppe on 20 Jan 2010 at 9:30

GoogleCodeExporter commented 9 years ago
the win7 grouping it seems to be a side effect of the way i did the 
classname... diff 
binary names is doing it

Original comment by dannydu...@gmail.com on 20 Jan 2010 at 9:41

GoogleCodeExporter commented 9 years ago
this is going to be awesome, especially if we can get rid of the titles and 
borders :-)

Original comment by dannydu...@gmail.com on 20 Jan 2010 at 9:42

GoogleCodeExporter commented 9 years ago

Original comment by andy.koppe on 25 Jan 2010 at 7:35