r/PowerShell •

[ Removed by moderator ]

[deleted] — view deleted post

0 Upvotes

10 comments sorted by

•

u/PowerShell-ModTeam 5d ago

Your post has been held for review due to repeated reports of AI written material without disclosure. If AI was used to write your post/script, repost with an AI Disclosure tag or statement. If not, message the moderators with additional details and a link to your post.

3

u/g3n3 6d ago

Looking at the enter readline handler, you really should be using the ast and parser library to derive your actions vs straight regex.

2

u/g3n3 6d ago

I can’t tell what this is. It certainly isn’t a shell. It might be a terminal. I don’t like the happy path using 5.1 which is deprecated. I don’t like the shell unexpectedly running cmd if there are forward slashes in the command line. Also there is some heuristic to run git bash or the default wsl instance’s bash shell.

-1

u/[deleted] 6d ago

Fair points, and you are right, it is a terminal, not a shell. Each line gets parsed and run by its real shell, PowerShell lines stay in PowerShell. 5.1 is the default only because that is what stock Windows ships with. PS7 as an engine is in but untested, that is honestly on my list.

2

u/g3n3 6d ago

I could see the overemployed or contracting folks liking this. Typically you want separate devices for work and personal. Don’t mix work and play. 😉

1

u/Schmatter_Raphiqui 6d ago

separate laptops breaks down pretty quick if you juggle four or five small retainer clients at once though, nobody wants a desk full of hardware just to push a hotfix

-1

u/[deleted] 6d ago

Ha, that is genuinely a big part of who this is for. Contractors juggling two clients kept asking me for exactly this. Separate devices is the clean way, agreed. This is for people stuck on one machine who still need the accounts kept apart.

1

u/g3n3 6d ago

I think I would have rather see this packaged as a powershell module for the “profile” switching. It is doing soo many things. I would expect folks in this world to already be using windows terminal or the like and you’d probably want to meet them where they are. I’d also wager some of these folks don’t even use the terminal and just sit in Claude desktop and tell the agent to run the commands.

Side note, Rex term is going to change the game and is the best upcoming term.

1

u/g3n3 6d ago

And also you want to use modern conpty and openconsole from windows terminal. They have a nuget package for it. I assume it is a C ABI.

1

u/g3n3 6d ago

It appears portable-pty would work but you have to ship both conpty.dll and openconsole.exe