Page 1 of 1

Shell and Arexx?

Posted: Fri Mar 10, 2017 9:35 am
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

Re: Shell and Arexx?

Posted: Fri Mar 10, 2017 10:24 am
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.

Re: Shell and Arexx?

Posted: Fri Mar 10, 2017 1:22 pm
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.

Re: Shell and Arexx?

Posted: Fri Mar 10, 2017 6:28 pm
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

Re: Shell and Arexx?

Posted: Fri Mar 10, 2017 11:12 pm
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.

Re: Shell and Arexx?

Posted: Sat Mar 11, 2017 7:40 am
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