Jump to content
darnocian

Console Manager for the Delphi IDE

Recommended Posts

Hi everyone,

 

Following fast on my last post, I thought I'd also share another development I've started  - a Console Manager for the Delphi IDE.

 

This is a tool that allows you to spin up a cmd.exe or powershell.exe within a dockable form, localised within the Delphi IDE.

 

Features:

- It is aware of the active project, so it will open up in the directory in which the dproj is located. It is still very alpha as in it just streams stdout/stdin, and not totally pleasant on the eye, but ok for an alpha POC.

- I've  got a little slider that allows you to zoom in/out.

- (planning) The ability to have lists of commands / saved environments that could be applied to a newly created session.

 

This is a POC, and still have some more work to do as I want to embrace the new pseudo console api which was introduced with the new Windows Terminal drive along with the VT emulation which would support colour, repositioning of the cursor, etc.

 

I have not released this publicly yet, but attached is a short video demonstrating how it works.

 

If you are interested in accessing it, please send me a mail: conrad.vermeulen@gmail.com. Let me know about what IDEs versions you may be interested in. I think I can do XE8 onwards.

 

I'll provide more information when it is officially released.

 

Regards,

Conrad

 

 

Edited by darnocian
  • Like 9

Share this post


Link to post

It's really nice 🙂

 

Will you considering directly docking cmd or PowerShell Windows ? In your video cmd or PowerShell Windows need to be moved and docked into Delphi.

 

Thanks for sharing this !

Share this post


Link to post
2 hours ago, Stéphane Wierzbicki said:

 Will you considering directly docking cmd or PowerShell Windows ? In your video cmd or PowerShell Windows need to be moved and docked into Delphi.

 

 

I will definitely try to explore the direct docking when I can.

 

I did ask David Millington about some of the features exposed via the ToolsAPI and there are some limitations... I think it would be nice for the console windows to be docked alongside the main console manager window, or possibly have some icons that can represent the preferred docking location (much like the alignment popup for controls in the object inspector). 

 

The dockable windows can be created, shown or hidden, but the ToolsAPI doesn't present other features currently. It may just be that I need to play around more as well. I found an ancient reference by Allen Bauer on the topic - it looked like it could have been the original prototype. But I'll see how that goes...

 

The first big step I'd like to make is getting full terminal emulation going properly.

 

Thanks again for your comments.

Share this post


Link to post

Just an idea... is it possible to inject a console window itself into a dockable panel? Maybe it would be easier than full terminal emulation which would lack many features anyway.

  • Like 1

Share this post


Link to post
21 hours ago, Fr0sT.Brutal said:

Just an idea... is it possible to inject a console window itself into a dockable panel? Maybe it would be easier than full terminal emulation which would lack many features anyway.

Agreed. 

 

I'll keep you posted on the evolution...

Edited by darnocian

Share this post


Link to post

I was not sure if the docking thing would be a hard or not, but decided to give it a shot... and result!

 

Thanks for the feedback.

 

 

  • Like 4

Share this post


Link to post

Well done Conrad! Several thoughts (feel free to ignore if any of them doesn't make sense):

  • Like others say, the console IDE extension should get more power by directly embedding cmd.exe or the PowerShell window.
  • Maybe it's more convenient to immediately create a console window for the current project, after clicking the Tools menu item.

Hope it helps.

Share this post


Link to post

Thanks Edwin.

35 minutes ago, Edwin Yip said:

Like others say, the console IDE extension should get more power by directly embedding cmd.exe or the PowerShell window.

I did mention it was a POC... and am aiming for the full 'embedded' experience. 😉

 

There isn't really a 'directly embedding' option from what I've researched, but open to any input on the matter. Essentially there are 2 ways I've read about:

- the legacy apis using the 'old style' win32 apis - what I've essentially seen happen is the guys hide the actual console that is created, and scrape the console buffer, console size and cursor information, and then redraw it. seems convoluted, but I believe this is what the cmd.exe hosting window does. I read this a few days ago, but can't recall the exact source. (and maybe I'm wrong - I'm open to that too) 😉 

- the 'new style' using the pseudo terminal apis - as Microsoft has embraced the unix world, the new pseudo terminal apis are aimed at bridging the legacy and unix philosophies... I'm still reading... I started so far creating bindings for some of the missing api functions from windows.pas etc...

 

I'll probably go down the 'new' way to future proof things, but the current version tickles my immediate itch, but I know there is more scratching on its way.

 

If there are simpler approaches, I'm open to hearing about them.  There are some 3rd party libs used in other IDEs like WinPty... I have not explored it yet, but also not sure if the additional dependency is really needed, except from a saving time perspective if it proves easy to do and does the job well.

 

35 minutes ago, Edwin Yip said:

Maybe it's more convenient to immediately create a console window for the current project, after clicking the Tools menu item.

i wanted to have a 'list' of consoles, as these windows can go invisible, so something needs to manage them.

 

I wanted to add a menu item in the right-click 'project structure'... but that menu is already so long...  But maybe on the main 'Project' menu in the IDE, the item could be for the current project. Although that may require an additional popup to select which terminal. I'm not totally happy with my current UI behaviour in  the current implementation as it presents a popup to give the window a name. if I present an option as a menu item, then a may want to have 2 options - start a powershell.exe, start a cmd.exe... the list can just get automatic naming, and people could rename afterwards if they desire.

Edited by darnocian

Share this post


Link to post

I know this topic area isn't supposed to be commercial. Would it be reasonable to charge a small $5-$10 to build and support this? Open to ideas on the matter. 

Share this post


Link to post
3 hours ago, darnocian said:

- the legacy apis using the 'old style' win32 apis - what I've essentially seen happen is the guys hide the actual console that is created, and scrape the console buffer, console size and cursor information, and then redraw it

Can of worms, as for me. I implemented piping of console processes and created some kind of limited console and had too much mess with quirks. Output buffering, direct console drawing, plenty of escape codes and so on.

Share this post


Link to post

I prefer my PS shells to be native.  There is so much functionality that can be lost otherwise.  

Share this post


Link to post
12 minutes ago, Lars Fosdal said:

I prefer my PS shells to be native.  There is so much functionality that can be lost otherwise.  

agreed. I think the newer api should be better for doing this sort of thing.

Share this post


Link to post

I do not know about political implication of charging.

But managing a lot of $5-10 in as many different payment channels is a bit of a PITA.

Embarcadero Play Store? Now that would probably be a bigger PITA.

Or maybe we have it already and i am just ignorant.

Running a one-man shop, these things plie up and becomes a resource-hog.

For me personally (at least this year), the /price/ is not a problem, the adm. around it is.

Share this post


Link to post

The question is this: do you want to get a wide adoption rate of something you've built or do you want to get two and a half coffees paid.

 

As for how the console is done: Visual Studio Code simply communicates via stdin/stdout/stderr - see https://vscode.readthedocs.io/en/latest/editor/integrated-terminal/ 

Edited by Stefan Glienke
  • Like 1

Share this post


Link to post
1 hour ago, Stefan Glienke said:

The question is this: do you want to get a wide adoption rate of something you've built or do you want to get two and a half coffees paid.

 

As for how the console is done: Visual Studio Code simply communicates via stdin/stdout/stderr - see https://vscode.readthedocs.io/en/latest/editor/integrated-terminal/ 

Or if you want to find a way to do constant updates and improvements or leave it abandoned.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×