Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A pane doesn't necessarily need to host a terminal. #997

Closed
zadjii-msft opened this issue May 24, 2019 · 4 comments · Fixed by #16170
Closed

A pane doesn't necessarily need to host a terminal. #997

zadjii-msft opened this issue May 24, 2019 · 4 comments · Fixed by #16170
Assignees
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal In-PR This issue has a related PR Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented May 24, 2019

A pane doesn't necessarily need to host a terminal. It could potentially host another UIElement. One could imagine enabling a user to quickly open up a Browser pane to search for a particular string without needing to leave the terminal.

notes:

@zadjii-msft zadjii-msft added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label May 24, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 24, 2019
@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. labels May 24, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 24, 2019
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone May 24, 2019
@mdtauk
Copy link

mdtauk commented May 24, 2019

This issue is related I believe #644

@DHowett-MSFT
Copy link
Contributor

From @sharpninja in #4719,

Description of the new feature/enhancement

I know this may seem way out there, but hear me out.

Windows Terminal is about tools. A single window open that has our command line tools in one place. There are many things that go along with that that are better when provided as a GUI, such as Settings for tools. In addition, other things, such as package managers, greatly benefit from having a GUI to observe listings of packages and their details. These GUIs are related to our open command prompts and it would be great of they could be shown in the same Window.

Proposed technical implementation details (optional)

A Visual Studio template would be created to build a Windows Terminal Plugin. It would have metadata that would specify commands that could be typed in the terminal that would be processed by Windows Terminal upon hitting Enter on the keyboard (and only when invoked from the keyboard) that if found would pass the entire command line to the Plugin. Example:

!packages nuget list Microsoft.Extensions.*

This would invoke a plugin named "packages" which would in turn parse the command line and determine it needed to get a list of packages from nuget that match Microsoft.Extensions.* and display the results in the GUI. It would only interact with the Profile it was invoked from.

Other examples are accelerators for Dotnet core such that a Plugin could be open with a set of buttons for common actions/macros that the user may need. This would be great for system admins who might administer 50 machines and run the same powershell commands on each of them. Currently she would have to add aliases to profiles on potentially each machine. No bueno! This way she sets up some macros in a GUI, enables the plugin for that Profile and then can invoke her predetermined commands.

Another really useful plugin would be a Text Editor that could be used for profiles and scripts. The data would be piped to/from the Console for reading and saving. Another example is a file manager that could be used to move data between profiles over encrypted pipes.

Performing actions against a profile would always be done through the Plugin system. Communication would be STDIN/STDOUT to the console. A GUI could take the whole window or split the window vertically or horizontally and be resizable. Plugins would be exposed through a Store and could be imported via nuget packages.

@zadjii-msft
Copy link
Member Author

zadjii-msft commented Sep 1, 2021

c66a566 might be a commit that enables this, accidentally while working on something else.

@zadjii-msft
Copy link
Member Author

<showerthought>

what if we just had the Terminal create an HWND in the space of that pane, and let a OOP extension just get that HWND and put whatever it wants into it? Terminal would be responsible for resizing the HWND, hiding it, whatever. It'd be a child HWND of the Terminal, so it'd necessarily be tied to our window. But then a 3p app could just put a Xaml Island in it's own child HWND, in its own process?

Terminal 
└── Our Xaml Island
    └── HwndPane HWND
        └── Extension HWND
            └── Extension Xaml Island

This was referenced Aug 31, 2023
@zadjii-msft zadjii-msft modified the milestones: Backlog, Terminal v1.20 Sep 19, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Oct 13, 2023
zadjii-msft added a commit that referenced this issue Mar 26, 2024
Instead of `Pane` hosting a `TermControl` directly, it now hosts an
`IPaneContent`. This is an abstraction between the TermControl and the
pane itself, to allow for arbitrary implementations of `IPaneContent`,
with things that might not be terminals.

## References and Relevant Issues

* #997
* #1000

## Detailed Description of the Pull Request / Additional comments

This PR by itself doesn't do much. It's just a refactoring. 
- It doesn't actually add any other types of pane content. 
- It overall just tries to move code whenever possible, with as little
refactoring as possible. There are some patterns from before that don't
super scale well to other types of pane content (think: the `xyzChanged`
events on `IPaneContent`).
- There's a few remaining places where Pane is explicitly checking if
its content is a terminal. We probably shouldn't, but meh

There are two follow-up PRs to this PR:
* #16171 
* #16172 

In addition, there's more work to be done after these merge:
* TODO! issue number for "Replace `IPaneContent::xyzChanged` with
`PropertyChanged` events"
* TODO! issue number for "Re-write state restoration so panes don't
produce `NewTerminalArgs`"

## Validation Steps Performed

* It still launches
* It still works
* Broadcasting still works
* The weird restart connection thing from #16001 still works

## PR Checklist
- [x] Closes #997


## other PRs
* #16170 <-- you are here 
* #16171
* #16172
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Mar 26, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 26, 2024
## Summary of the Pull Request

Builds upon #16170. This PR simply adds a singly type of non-terminal
pane - a "scratchpad pane". This is literally just a single text box, in
a pane. It's on the `{ "command": "experimental.openScratchpad" }`
action.

## References and Relevant Issues

See: #997

## Detailed Description of the Pull Request / Additional comments

I also put it behind velocity so it won't even go into preview while
this bakes.

This is really just here to demonstrate that this works, and is viable.
The next PR is much more interesting.

## Validation Steps Performed
Screenshot below. 


## other PRs
* #16170
* #16171 <-- you are here 
* #16172
github-merge-queue bot pushed a commit that referenced this issue Apr 3, 2024
... technically. We still won't let it actually _be_ a pane, but now it
acts like one. It's hosted in a `SettingsPaneContent`. There's no more
`SettingsTab`. It totally _can_ be in a pane (but don't?)

## Validation Steps Performed

* Still opens the settings
* Only opens a single settings tab, or re-activates the existing one
* Session restores!
* Updates the title of the tab appropriately
* I previously _did_ use the scratchpad action to open the settings in a
pane, and that worked.

## Related PRs
* #16170
  * #16171 
    * #16172 <-- you are here 
      * #16895

Refs #997
Closes #8452
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal In-PR This issue has a related PR Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants