List of open consoles

6 posts / 0 new
Last post
JosDuchIt
JosDuchIt's picture
Offline
Last seen: 8 years 6 days ago
Joined: 2012-01-08 20:57
List of open consoles

Does the system maintains a list of open consoles? (CON, KCON & other)
If not where could one start to compile such a list?

hypex
hypex's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2011-09-09 16:20
This certainly looks like a

This certainly looks like a hard one. AFAIK no such list is maintained. And as there can be different handlers as you implied with CON, KCON and any other makes this even hard.

In any case, by console, do you mean a console structure as well the window? Linking a console to a window is not as clear cut that I can recall but should be possible.

But, I think I may have found close to what you are looking for. MaxCli() can give you a max CLI number and if you iterate up to this number using FindCliProc() you will get the process for each CLI. You can then us that to extract a CommandLineInterface pointer and WindowPtr.

Possibly you could go through the Intuition window list and compare each message port with the window ports as well. But only if the WindowPtr didn't work.

I found the following to be a good starting point:
http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_3._guide/node0191.html

JosDuchIt
JosDuchIt's picture
Offline
Last seen: 8 years 6 days ago
Joined: 2012-01-08 20:57
Thanks a lot. It is open

Thanks a lot.
It is open console windows i am after. I would like to be able to resize & reposition them in an ordered way. If i can do that i might look at application windows

hypex
hypex's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2011-09-09 16:20
Okay I see what you

Okay I see what you need.

Well I tested my theory and WindowPtr and doesn't return an actual consoles window. So looks like you may have to do this the hard core way. :-)

That is to go through the window list and cross reference the window port with known shell processes.

Anorher thing you could try is recording which windows have "AmigaShell" as the window name but that may be unreliable.

xenic
xenic's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2011-05-07 04:52
@JosDuchIt I assume you

@JosDuchIt
I assume you realize that a console window is not necessarily a shell window. A shell just uses a console window for input and output. You can open a console by entering something like: echo "Testing console" >CON:440/220/600/200/Ami/CLOSE/WAIT/ALT70/22/800/584 . Consoles and shell windows can appear on any public screen, so even if you could identify all of them you would need to check if they appear on the screen you want to rearrange. Lots of programs open console windows for debug or error output. I suspect that what you want to rearrange are shell windows; in which case looking for the window title or shell processes as Hypex suggested might be the best approach. If you are looking for shell processes you will still need to know what screen the shell is on. I open shell windows of my Internet screen (from a ScriptLauncher window on that screen) as well as some other application screens. I also use a KCON: console for my shell windows and have a custom shell window title :-)

X1000 - OS 4.1FE

JosDuchIt
JosDuchIt's picture
Offline
Last seen: 8 years 6 days ago
Joined: 2012-01-08 20:57
@Hypex & Xenic thanks for

@Hypex & Xenic thanks for your help.
As it looks indeed more complicated than i hoped, i'll just wait & see if this gets on top of my todo list

Log in or register to post comments