Page 1 of 1

Need Script and Menu for Launching Windows Terminal from Here

Posted: 28 Sep 2025 18:49
by Jerry
[Using XYplorer 64bit 28.00.0006]

I want a menu with an item for Opening Windows Terminal from Here -- ie. opened to the currently selected folder in the Tree or the folder currently opened in the File List. Ideally, I'd like the option to be on the context menu that pops up when I right-click on any folder in the tree. The other requirement is that if Windows Terminal is already running, I want a new tab created in that existing process opened to the target folder. But that's a secondary requirement.

Can somebody spell out the steps and code in detail to do this? (I am embarrassed to admit that after using XYplorer for 15 years, I have not developed the necessary scripting skills!)

Re: Need Script and Menu for Launching Windows Terminal from Here

Posted: 28 Sep 2025 19:13
by highend
You can't add such a call to an existing XY context menu so e.g. use a right-click on white CEA script event with

Code: Select all

$wt = "your path to\wt.exe";
    run lax("$wt" -w 0 nt -d "<curpath>");

Re: Need Script and Menu for Launching Windows Terminal from Here

Posted: 29 Sep 2025 00:30
by Jerry
highend wrote: 28 Sep 2025 19:13 You can't add such a call to an existing XY context menu so e.g. use a right-click on white CEA script event with

Code: Select all

$wt = "your path to\wt.exe";
    run lax("$wt" -w 0 nt -d "<curpath>");
Ok, I have that working. But is there any way to make <curpath> or another variable pick up the folder that's on the same line in the tree where you right-clicked, wherever that is? Because as coded, it just uses the folder currently opened in the file list.

(Which leads me to wonder, why not have a configurable whitespace context menu in the folder tree, generally, when you want to do something with a folder that's not the one currently opened in the list. Or perhaps an alternative, configurable context menu that pops up when you do shift right mouse click directly on any folder in the tree.)

Re: Need Script and Menu for Launching Windows Terminal from Here

Posted: 29 Sep 2025 07:14
by highend
Your only option for the tree is the middle click on a folder there, right-clicking on white doesn't return the folder on that line

CEA - Clicking on items - Middle-click on folder

Code: Select all

$wt = "your path to\wt.exe";
    run lax("$wt" -w 0 nt -d "<CEA_ClickedItem>");

Re: Need Script and Menu for Launching Windows Terminal from Here

Posted: 29 Sep 2025 14:36
by Jerry
highend wrote: 29 Sep 2025 07:14 Your only option for the tree is the middle click on a folder there, right-clicking on white doesn't return the folder on that line

CEA - Clicking on items - Middle-click on folder

Code: Select all

$wt = "your path to\wt.exe";
    run lax("$wt" -w 0 nt -d "<CEA_ClickedItem>");
Thanks! That's a workable solution. [And I switched to using Tabby. Much better than Microsoft Terminal]