Shell and Arexx?

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
Raziel
Posts: 980
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Shell and Arexx?

Post by Raziel »

I take it the new Shell doesn't have an Arexx port?

I would like to write a script which checks for an already open shell and if there is simply activate it and open a new tab instead of spawning a complete new shell.

Sometimes my shell window is buried deep underneath other windows and i end up with dozens of shells (because i forgot about it being open) which kind of counteracts the new shell tab possibility.

Is there any chance to do that without writing something that patches into the system?

I tried the Workbench Arexx functionality but that does seem to affect only drives, drawers and the Workkbench window itself, but not programs.

Thanks in advance
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1438
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Shell and Arexx?

Post by tonyw »

No, the Shell does not have an ARexx port.

I put some thought into it some years ago, but there are three components involved: the Shell (Kickstart/shell.kmod), the I/O handler (console handler, Kickstart/con-handler) and the display (console device, Kickstart/console.device). Only the console device has a menu and that serves only to control the console window.

What do you want to do with the ARexx port? If you just want to write stuff to the screen, you would probably want to add commands upstream of the con-handler, where the interface is a CON: device.
If you want to change the look or configuration of the console window, then you would still need to add commands upstream of the con-handler, so that it is aware of the changes to its output device. I guess that this is what you want to do, by creating new console tabs in an existing window. For that, you need a new CON: instance, and only the Shell or the built-in "Execute" command can do that (Execute "NewShell CON://...).
Lastly, if you want to issue shell commands, then you need to interface at the user input level - you may as well use the built-in "Execute" command to do that for you, too.
cheers
tony
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 591
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Shell and Arexx?

Post by broadblues »

Sometimes my shell window is buried deep underneath other windows and i end up with dozens of shells (because i forgot about it being open) which kind of counteracts the new shell tab possibility.
I use the DepthToFront commodity to find burried shell windows, not quite what you are asking about, but an alternate solution.
User avatar
Raziel
Posts: 980
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Shell and Arexx?

Post by Raziel »

@tonyw
What do you want to do with the ARexx port?
The first idea was to issue a script whenever i open a new shell which would check if a shell window is already present and through the script bring the running shell to front and instead open a new "tab/shell" there rather than opening a complete new shell instance.
Just like it commonly done with internet browers.

The script could then be enhanced with whatever i need it do do

Guess there won't be a chance then
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1438
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Shell and Arexx?

Post by tonyw »

I tend to open a new shell window whenever I want to start something new like that. I keep a Shell window for whatever task I'm working on (I usually have several tabs open with different current directories, but all associated with that one job).

So if I am developing, there will be a Shell with tabs for the source directory (where I am issuing commands like "make"), another tab where I issue "search" commands, another for RAM:, where I am capturing debug output from the nearby test machine, etc. There will usually be 3-5 tabs open.
If I am working on another development task at the same time, I will have a dedicated Shell window for that, again with multiple tabs. The non-working shell window(s) will usually be iconified.

There is not much more overhead involved in opening another window - just the window and its data structures. Most of the memory is used by the display for each console instance.
cheers
tony
User avatar
Raziel
Posts: 980
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Shell and Arexx?

Post by Raziel »

It's not really about the overhead or memory consumption, it's more a thing of keeping everything in one place :-)

Thank you for the insight, though
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Post Reply