* update extension to 15.6 and xterm.js 3

* send close events

* switch to async package

* separate options model from view

* actually load options

* make command code more idiomatic

* remove font declaration

* bump appveyor node version

* add build artifacts

* move async out of the options model

* exclude winpty debug files

* create solution service wrapper

* switch to main thread before initializing the command

* reintroduce terminal restarting

* start preparing service

* get solution changing working

* more robust solution change detection

* add option to control solution changing

* restore themed coloring

* add better default fonts

* add options and fix directory load

* begin typescript port

* fix typescript building

* move node_modules out of the project

* switch to requirejs module loader

* fix typescript module runtime issue

* port link matcher and keyboard handlers.

* hook up typescript frontend to backend

* use crlf endings in .html files

* use scripts from the great and powerful mads

* switch to revision building

* add change log

* switch to async tool windows.

* supress extra dlls

* suppress script errors

* beging prototyping service API

* add more service boilerplate

* create service boilerplate

* rename projects

* rename embeddable types folder

* move terminal project

* change namespace of existing types

* support multiple tool windows

* split up tool windows into two distinct types

* add service testing project

* send the close event

* subscribe to closed event in test project

* enable directory changing

* generate nuget package

* fix yaml

* downgrade vssdk package

* fix build version incrementing

* fix nuget version bump

* change artifact paths

* fix nuget package path again

* make types work with embedding

* make directory change async

* add nuget target

* refactor solutionutils

* rename terminal services

* rename nuget target

* actually pass the shell path to servicehub

* address feedback and add environment var support

* restore cursor blinking
This commit is contained in:
Daniel Griffen 2018-02-28 13:39:54 -08:00 коммит произвёл GitHub
Родитель 3e36f6ba7a
Коммит 88a2515260
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
84 изменённых файлов: 3274 добавлений и 1437 удалений

1
.gitattributes поставляемый Normal file
Просмотреть файл

@ -0,0 +1 @@
*.html eol=crlf

3
.gitignore поставляемый
Просмотреть файл

@ -1,3 +1,6 @@
## Project specific files
EmbeddedTerminal/WebView/js
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

74
CHANGELOG.md Normal file
Просмотреть файл

@ -0,0 +1,74 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.2.8] - 2017-9-22
### Added
- Option to pass command line parameters to terminal.
### Changed
- Extension no longer turns off local machine lockdown for the entire process.
## [0.2.7] - 2017-9-15
### Added
- Font options in the CSS template.
### Changed
- Ctrl+O, Ctrl+P, and Ctrl+Tab are now handled by VS.
### Fixed
- Goto error now correctly focuses the editor.
## [0.2.6] - 2017-8-11
### Fixed
- Fixed problem with relative paths and ~ in path name.
## [0.2.5] - 2017-8-10
### Added
- Options menu, user can select default shell and choose a custom CSS file.
- Error links, build errors can be clicked to take you to source location.
### Fixed
- Terminal was not focusing when the window gained focus.
## 0.2.4 - 2017-8-7
### Changed
- No longer rely on internal APIs.
### Fixed
- Fix issue where terminal window would not correctly capture focus.
## 0.2.3 - 2017-7-29
### Fixed
- Fix resize that previous release broke.
## 0.2.2 - 2017-7-29
### Added
- Copy and paste support (Ctrl+C/Ctrl+V and right-click).
### Fixed
- Exit no longer zombies the terminal, exiting the terminal restarts.
- Reduced massive extension size.
- Opening two instances no longer zombies the shell.
## 0.2.1 - 2017-7-25
### Changed
- Cursor now blinks by default.
### Fixed
- Unthemed cursor.
# 0.2.0 - 2017-7-25
- Initial MVP release
[Unreleased]: https://github.com/Microsoft/WhackWhackTerminal/compare/v0.2.8...HEAD
[0.2.8]:https://github.com/Microsoft/WhackWhackTerminal/compare/v0.2.7...v0.2.8
[0.2.7]:https://github.com/Microsoft/WhackWhackTerminal/compare/v0.2.6...v0.2.7
[0.2.6]:https://github.com/Microsoft/WhackWhackTerminal/compare/v0.2.5...v0.2.6
[0.2.5]:https://github.com/Microsoft/WhackWhackTerminal/compare/v0.2.4...v0.2.5

Просмотреть файл

@ -1,451 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<UseCodebase>true</UseCodebase>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{ED2D97CC-2A98-48D4-AE1F-2277CB987C04}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>EmbeddedTerminal</RootNamespace>
<AssemblyName>WhackWhackTerminal</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<StartAction>Program</StartAction>
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootsuffix Exp</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="BetterBrowser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TerminalOptionPage.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="TermWindow.cs" />
<Compile Include="TermWindowCommand.cs" />
<Compile Include="TermWindowControl.xaml.cs">
<DependentUpon>TermWindowControl.xaml</DependentUpon>
</Compile>
<Compile Include="TermWindowPackage.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="BrandWhackWhackTerminal_256x.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="view\custom.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="view\default.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="service\pty.js">
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="node_modules\xterm\dist\addons\attach\attach.js" />
<Content Include="node_modules\xterm\dist\addons\fit\fit.js">
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="node_modules\xterm\dist\addons\fullscreen\fullscreen.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\xterm\dist\addons\fullscreen\fullscreen.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\xterm\dist\addons\linkify\linkify.js" />
<Content Include="node_modules\xterm\dist\addons\terminado\terminado.js" />
<Content Include="node_modules\xterm\dist\xterm.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\xterm\dist\xterm.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\xterm\gulpfile.js" />
<Content Include="node_modules\xterm\lib\addons\attach\attach.js" />
<Content Include="node_modules\xterm\lib\addons\fit\fit.js" />
<Content Include="node_modules\xterm\lib\addons\fullscreen\fullscreen.css" />
<Content Include="node_modules\xterm\lib\addons\fullscreen\fullscreen.js" />
<Content Include="node_modules\xterm\lib\addons\terminado\terminado.js" />
<Content Include="node_modules\xterm\lib\Charsets.js" />
<Content Include="node_modules\xterm\lib\CompositionHelper.js" />
<Content Include="node_modules\xterm\lib\CompositionHelper.test.js" />
<Content Include="node_modules\xterm\lib\EscapeSequences.js" />
<Content Include="node_modules\xterm\lib\EventEmitter.js" />
<Content Include="node_modules\xterm\lib\EventEmitter.test.js" />
<Content Include="node_modules\xterm\lib\handlers\Clipboard.js" />
<Content Include="node_modules\xterm\lib\handlers\Clipboard.test.js" />
<Content Include="node_modules\xterm\lib\InputHandler.js" />
<Content Include="node_modules\xterm\lib\InputHandler.test.js" />
<Content Include="node_modules\xterm\lib\Interfaces.js" />
<Content Include="node_modules\xterm\lib\Linkifier.js" />
<Content Include="node_modules\xterm\lib\Linkifier.test.js" />
<Content Include="node_modules\xterm\lib\Parser.js" />
<Content Include="node_modules\xterm\lib\Renderer.js" />
<Content Include="node_modules\xterm\lib\SelectionManager.js" />
<Content Include="node_modules\xterm\lib\SelectionManager.test.js" />
<Content Include="node_modules\xterm\lib\SelectionModel.js" />
<Content Include="node_modules\xterm\lib\SelectionModel.test.js" />
<Content Include="node_modules\xterm\lib\test\addons\test.js" />
<Content Include="node_modules\xterm\lib\test\escape-sequences-test.js" />
<Content Include="node_modules\xterm\lib\test\test.js" />
<Content Include="node_modules\xterm\lib\Types.js" />
<Content Include="node_modules\xterm\lib\utils\Browser.js" />
<Content Include="node_modules\xterm\lib\utils\CharMeasure.js" />
<Content Include="node_modules\xterm\lib\utils\CharMeasure.test.js" />
<Content Include="node_modules\xterm\lib\utils\CircularList.js" />
<Content Include="node_modules\xterm\lib\utils\CircularList.test.js" />
<Content Include="node_modules\xterm\lib\utils\DomElementObjectPool.js" />
<Content Include="node_modules\xterm\lib\utils\DomElementObjectPool.test.js" />
<Content Include="node_modules\xterm\lib\utils\Generic.js" />
<Content Include="node_modules\xterm\lib\utils\Mouse.js" />
<Content Include="node_modules\xterm\lib\Viewport.js" />
<Content Include="node_modules\xterm\lib\Viewport.test.js" />
<Content Include="node_modules\xterm\lib\xterm.css" />
<Content Include="node_modules\xterm\lib\xterm.js" />
<Content Include="node_modules\xterm\src\addons\attach\attach.js" />
<Content Include="node_modules\xterm\src\addons\fit\fit.js" />
<Content Include="node_modules\xterm\src\addons\fullscreen\fullscreen.css" />
<Content Include="node_modules\xterm\src\addons\fullscreen\fullscreen.js" />
<Content Include="node_modules\xterm\src\addons\terminado\terminado.js" />
<Content Include="node_modules\xterm\src\Charsets.ts" />
<Content Include="node_modules\xterm\src\CompositionHelper.test.ts" />
<Content Include="node_modules\xterm\src\CompositionHelper.ts" />
<Content Include="node_modules\xterm\src\EscapeSequences.ts" />
<Content Include="node_modules\xterm\src\EventEmitter.test.ts" />
<Content Include="node_modules\xterm\src\EventEmitter.ts" />
<Content Include="node_modules\xterm\src\handlers\Clipboard.test.ts" />
<Content Include="node_modules\xterm\src\handlers\Clipboard.ts" />
<Content Include="node_modules\xterm\src\InputHandler.test.ts" />
<Content Include="node_modules\xterm\src\InputHandler.ts" />
<Content Include="node_modules\xterm\src\Interfaces.ts" />
<Content Include="node_modules\xterm\src\Linkifier.test.ts" />
<Content Include="node_modules\xterm\src\Linkifier.ts" />
<Content Include="node_modules\xterm\src\Parser.ts" />
<Content Include="node_modules\xterm\src\Renderer.ts" />
<Content Include="node_modules\xterm\src\SelectionManager.test.ts" />
<Content Include="node_modules\xterm\src\SelectionManager.ts" />
<Content Include="node_modules\xterm\src\SelectionModel.test.ts" />
<Content Include="node_modules\xterm\src\SelectionModel.ts" />
<Content Include="node_modules\xterm\src\test\addons\test.js" />
<Content Include="node_modules\xterm\src\test\escape-sequences-test.js" />
<Content Include="node_modules\xterm\src\test\test.js" />
<Content Include="node_modules\xterm\src\Types.ts" />
<Content Include="node_modules\xterm\src\utils\Browser.ts" />
<Content Include="node_modules\xterm\src\utils\CharMeasure.test.ts" />
<Content Include="node_modules\xterm\src\utils\CharMeasure.ts" />
<Content Include="node_modules\xterm\src\utils\CircularList.test.ts" />
<Content Include="node_modules\xterm\src\utils\CircularList.ts" />
<Content Include="node_modules\xterm\src\utils\DomElementObjectPool.test.ts" />
<Content Include="node_modules\xterm\src\utils\DomElementObjectPool.ts" />
<Content Include="node_modules\xterm\src\utils\Generic.ts" />
<Content Include="node_modules\xterm\src\utils\Mouse.ts" />
<Content Include="node_modules\xterm\src\Viewport.test.ts" />
<Content Include="node_modules\xterm\src\Viewport.ts" />
<Content Include="node_modules\xterm\src\xterm.css" />
<Content Include="node_modules\xterm\src\xterm.js" />
<Content Include="view\linkMatcher.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="Key.snk" />
<Content Include="service\wwt.pty.servicehub.service.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="node_modules\xterm\bower.json" />
<None Include="node_modules\xterm\dist\addons\attach\package.json" />
<None Include="node_modules\xterm\dist\addons\fit\package.json" />
<None Include="node_modules\xterm\dist\addons\fullscreen\package.json" />
<None Include="node_modules\xterm\dist\addons\terminado\package.json" />
<None Include="node_modules\xterm\dist\xterm.js.map" />
<None Include="node_modules\xterm\jsdoc.json" />
<None Include="node_modules\xterm\lib\addons\attach\package.json" />
<None Include="node_modules\xterm\lib\addons\fit\package.json" />
<None Include="node_modules\xterm\lib\addons\fullscreen\package.json" />
<None Include="node_modules\xterm\lib\addons\terminado\package.json" />
<None Include="node_modules\xterm\lib\Charsets.js.map" />
<None Include="node_modules\xterm\lib\CompositionHelper.js.map" />
<None Include="node_modules\xterm\lib\CompositionHelper.test.js.map" />
<None Include="node_modules\xterm\lib\EscapeSequences.js.map" />
<None Include="node_modules\xterm\lib\EventEmitter.js.map" />
<None Include="node_modules\xterm\lib\EventEmitter.test.js.map" />
<None Include="node_modules\xterm\lib\handlers\Clipboard.js.map" />
<None Include="node_modules\xterm\lib\handlers\Clipboard.test.js.map" />
<None Include="node_modules\xterm\lib\InputHandler.js.map" />
<None Include="node_modules\xterm\lib\InputHandler.test.js.map" />
<None Include="node_modules\xterm\lib\Interfaces.js.map" />
<None Include="node_modules\xterm\lib\Linkifier.js.map" />
<None Include="node_modules\xterm\lib\Linkifier.test.js.map" />
<None Include="node_modules\xterm\lib\Parser.js.map" />
<None Include="node_modules\xterm\lib\Renderer.js.map" />
<None Include="node_modules\xterm\lib\SelectionManager.js.map" />
<None Include="node_modules\xterm\lib\SelectionManager.test.js.map" />
<None Include="node_modules\xterm\lib\SelectionModel.js.map" />
<None Include="node_modules\xterm\lib\SelectionModel.test.js.map" />
<None Include="node_modules\xterm\lib\test\addons\test.js.map" />
<None Include="node_modules\xterm\lib\test\escape-sequences-test.js.map" />
<None Include="node_modules\xterm\lib\test\test.js.map" />
<None Include="node_modules\xterm\lib\Types.js.map" />
<None Include="node_modules\xterm\lib\utils\Browser.js.map" />
<None Include="node_modules\xterm\lib\utils\CharMeasure.js.map" />
<None Include="node_modules\xterm\lib\utils\CharMeasure.test.js.map" />
<None Include="node_modules\xterm\lib\utils\CircularList.js.map" />
<None Include="node_modules\xterm\lib\utils\CircularList.test.js.map" />
<None Include="node_modules\xterm\lib\utils\DomElementObjectPool.js.map" />
<None Include="node_modules\xterm\lib\utils\DomElementObjectPool.test.js.map" />
<None Include="node_modules\xterm\lib\utils\Generic.js.map" />
<None Include="node_modules\xterm\lib\utils\Mouse.js.map" />
<None Include="node_modules\xterm\lib\Viewport.js.map" />
<None Include="node_modules\xterm\lib\Viewport.test.js.map" />
<None Include="node_modules\xterm\lib\xterm.js.map" />
<None Include="node_modules\xterm\LICENSE" />
<None Include="node_modules\xterm\package.json" />
<None Include="node_modules\xterm\README.md" />
<None Include="node_modules\xterm\src\addons\attach\package.json" />
<None Include="node_modules\xterm\src\addons\fit\package.json" />
<None Include="node_modules\xterm\src\addons\fullscreen\package.json" />
<None Include="node_modules\xterm\src\addons\terminado\package.json" />
<None Include="node_modules\xterm\tsconfig.json" />
<None Include="node_modules\xterm\tslint.json" />
<None Include="node_modules\xterm\typings.json" />
<None Include="package-lock.json" />
<None Include="package.json" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="view\default.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="view\default.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="ReleaseNotes.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<VSCTCompile Include="TermWindowPackage.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<SubType>Designer</SubType>
</VSCTCompile>
</ItemGroup>
<ItemGroup>
<!-- <Content Include="node_modules\node-pty\**\*" Exclude="node_modules\node-pty\build\deps\**\*;node_modules\node-pty\deps\**\*;node_modules\node-pty\src\**\*">
<IncludeInVSIX>true</IncludeInVSIX>
</Content> -->
<Content Include="node_modules\node-pty\*;node_modules\node-pty\lib\**\*;node_modules\node-pty\build\Release\**\*">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\vscode-jsonrpc\**\*">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<ItemGroup>
<Page Include="TermWindowControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.ServiceHub.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.ServiceHub.Client.1.0.226-rc\lib\net46\Microsoft.ServiceHub.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.CommandBars, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.CoreUtility.15.0.26606\lib\net45\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Imaging, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Imaging.15.0.26606\lib\net45\Microsoft.VisualStudio.Imaging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.15.0.15.0.26201\lib\Microsoft.VisualStudio.Shell.15.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Framework.15.0.26606\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30110\lib\Microsoft.VisualStudio.Shell.Interop.12.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.15.0.26606\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Threading, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Threading.15.2.5\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Utilities.15.0.26607\lib\net46\Microsoft.VisualStudio.Utilities.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Workspace, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Workspace.VSIntegration.Contracts, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="StreamJsonRpc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\StreamJsonRpc.1.0.36\lib\net45\StreamJsonRpc.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="VSPackage.resx">
<MergeWithCTO>true</MergeWithCTO>
<ManifestResourceName>VSPackage</ManifestResourceName>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.9\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.9\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.9\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.9\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -1,36 +0,0 @@
Whack Whack Terminal
2017-9-22 v0.2.8
- New option to pass command line parameters to the terminal on startup
- Fix terminal turning of local machine lockdown for the entire process
2017-9-15 v0.2.7
- Goto error will now focus on the editor correctly in all situations
- Ctrl+O, Ctrl+P, and Ctrl+Tab are now handled by VS
- Font options were added to the css template
2017-8-11 v0.2.6
- Fix issue with parsing file paths
2017-8-10 v0.2.5
- Added an options menu, user can select default shell and choose a custom CSS file
- Added error-links, build errors can be clicked on to take you to their location in a file
- fixed terminal not focusing when shortcut was pressed
2017-8-7 v0.2.4
- updated codebase to no longer use internal apis
- fixed some window focus issues
2017-7-29 v0.2.3
- fixed resizing that was broken by last release
2017-7-29 v0.2.2
- exit no longer zombies terminal, exiting the last terminal restarts
- extension size greatly reduced
- opening two VS instances will no longer zombie one shell
- copy and paste support (Ctrl+C/Ctrl+V and right-click)
2017-7-25 v0.2.1
- Theme and blink the cursor
2017-7-25 v0.2.0
- Initial MVP Release

Просмотреть файл

@ -1,101 +0,0 @@
using System;
using System.ComponentModel.Design;
using System.Globalization;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
namespace EmbeddedTerminal
{
/// <summary>
/// Command handler
/// </summary>
internal sealed class TermWindowCommand
{
/// <summary>
/// Command ID.
/// </summary>
public const int CommandId = 0x0100;
/// <summary>
/// Command menu group (command set GUID).
/// </summary>
public static readonly Guid CommandSet = new Guid("99c4f0ff-b5ca-40de-98a2-e0c4f2725977");
/// <summary>
/// VS Package that provides this command, not null.
/// </summary>
private readonly Package package;
/// <summary>
/// Initializes a new instance of the <see cref="TermWindowCommand"/> class.
/// Adds our command handlers for menu (commands must exist in the command table file)
/// </summary>
/// <param name="package">Owner package, not null.</param>
private TermWindowCommand(Package package)
{
if (package == null)
{
throw new ArgumentNullException("package");
}
this.package = package;
OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
if (commandService != null)
{
var menuCommandID = new CommandID(CommandSet, CommandId);
var menuItem = new MenuCommand(this.ShowToolWindow, menuCommandID);
commandService.AddCommand(menuItem);
}
}
/// <summary>
/// Gets the instance of the command.
/// </summary>
public static TermWindowCommand Instance
{
get;
private set;
}
/// <summary>
/// Gets the service provider from the owner package.
/// </summary>
private IServiceProvider ServiceProvider
{
get
{
return this.package;
}
}
/// <summary>
/// Initializes the singleton instance of the command.
/// </summary>
/// <param name="package">Owner package, not null.</param>
public static void Initialize(Package package)
{
Instance = new TermWindowCommand(package);
}
/// <summary>
/// Shows the tool window when the menu item is clicked.
/// </summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event args.</param>
private void ShowToolWindow(object sender, EventArgs e)
{
// Get the instance number 0 of this tool window. This window is single instance so this instance
// is actually the only one.
// The last flag is set to true so that if the tool window does not exists it will be created.
ToolWindowPane window = this.package.FindToolWindow(typeof(TermWindow), 0, true);
if ((null == window) || (null == window.Frame))
{
throw new NotSupportedException("Cannot create tool window");
}
IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
}
}
}

Просмотреть файл

@ -1,49 +0,0 @@
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:EmbeddedTerminal"
xmlns:platformui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
x:Class="EmbeddedTerminal.TermWindowControl"
Background="{DynamicResource VsBrush.Window}"
Foreground="{DynamicResource VsBrush.WindowText}"
x:Name="MyToolWindow">
<Grid x:Name="mainGrid">
<local:BetterBrowser x:Name="terminalView">
<local:BetterBrowser.CustomCSS>
<local:CustomCSSRule Selector=".terminal">
<local:CustomCSSRule.Declarations>
<local:CSSDeclaration Attribute="Color" Value="{x:Static platformui:EnvironmentColors.ToolboxContentTextColorKey}" />
</local:CustomCSSRule.Declarations>
</local:CustomCSSRule>
<local:CustomCSSRule Selector=".terminal .xterm-viewport">
<local:CustomCSSRule.Declarations>
<local:CSSDeclaration Attribute="BackgroundColor" Value="{x:Static platformui:EnvironmentColors.ToolboxBackgroundColorKey}" />
</local:CustomCSSRule.Declarations>
</local:CustomCSSRule>
<local:CustomCSSRule Selector=".terminal .xterm-color-15">
<local:CustomCSSRule.Declarations>
<local:CSSDeclaration Attribute="Color" Value="{x:Static platformui:EnvironmentColors.ToolboxContentTextColorKey}" />
</local:CustomCSSRule.Declarations>
</local:CustomCSSRule>
<local:CustomCSSRule Selector=".terminal .xterm-selection div">
<local:CustomCSSRule.Declarations>
<local:CSSDeclaration Attribute="BackgroundColor" Value="{x:Static platformui:EnvironmentColors.SystemHighlightColorKey}" />
</local:CustomCSSRule.Declarations>
</local:CustomCSSRule>
<local:CustomCSSRule Selector=".terminal.focus:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar) .terminal-cursor">
<local:CustomCSSRule.Declarations>
<local:CSSDeclaration Attribute="Color" Value="{x:Static platformui:EnvironmentColors.ToolboxBackgroundColorKey}" />
<local:CSSDeclaration Attribute="BackgroundColor" Value="{x:Static platformui:EnvironmentColors.ToolboxContentTextColorKey}" />
</local:CustomCSSRule.Declarations>
</local:CustomCSSRule>
<local:CustomCSSRule Selector=".terminal:not(.focus) .terminal-cursor">
<local:CustomCSSRule.Declarations>
<local:CSSDeclaration Attribute="OutlineColor" Value="{x:Static platformui:EnvironmentColors.ToolboxContentTextColorKey}" />
</local:CustomCSSRule.Declarations>
</local:CustomCSSRule>
</local:BetterBrowser.CustomCSS>
</local:BetterBrowser>
</Grid>
</UserControl>

Просмотреть файл

@ -1,266 +0,0 @@
namespace EmbeddedTerminal
{
using Microsoft.VisualStudio.Shell;
using System.ComponentModel.Design;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System;
using EnvDTE;
using Microsoft.VisualStudio.Shell.Interop;
using System.Runtime.InteropServices;
using Microsoft.ServiceHub.Client;
using StreamJsonRpc;
using System.Security.Permissions;
using System.Windows.Threading;
using System.Text.RegularExpressions;
/// <summary>
/// Interaction logic for TermWindowControl.
/// </summary>
public partial class TermWindowControl : UserControl
{
/// <summary>
/// Initializes a new instance of the <see cref="TermWindowControl"/> class.
/// </summary>
public TermWindowControl()
{
this.InitializeComponent();
this.Focusable = true;
this.GotFocus += TermWindowControl_GotFocus;
var client = new HubClient();
var clientStream = client.RequestServiceAsync("wwt.pty").Result;
var helper = new ScriptHelper(this, clientStream, Dispatcher.CurrentDispatcher);
this.terminalView.ScriptingObject = helper;
string extensionDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string rootPath = Path.Combine(extensionDirectory, "view\\default.html").Replace("\\\\", "\\");
this.terminalView.Navigate(new Uri(rootPath));
}
private void TermWindowControl_GotFocus(object sender, RoutedEventArgs e)
{
// We call focus here because if we don't, the next call will prevent the toolbar from turning blue.
// No functionality is lost when this happens but it is not consistent with VS design conventions.
this.Focus();
this.terminalView.Invoke("invokeTerm", "focus");
}
}
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
public class ScriptHelper
{
#region regexconsts
/* Regex's originally from VSCode.
* VSCode is licensed under the MIT license, original sources and license.txt can be found here:
* https://github.com/Microsoft/vscode
*/
const string winDrivePrefix = "[a-zA-Z]:";
const string winPathPrefix = "(" + winDrivePrefix + "|\\.\\.?|\\~)";
const string winPathSeparatorClause = "(\\\\|\\/)";
const string winExcludedPathCharactersClause = "[^\\0<>\\?\\|\\/\\s!$`&*()\\[\\]+\'\":;]";
/** A regex that matches paths in the form c:\foo, ~\foo, .\foo, ..\foo, foo\bar */
const string winLocalLinkClause = "((" + winPathPrefix + "|(" + winExcludedPathCharactersClause + ")+)?(" + winPathSeparatorClause + "(" + winExcludedPathCharactersClause + ")+)+)";
/** As xterm reads from DOM, space in that case is nonbreaking char ASCII code - 160,
replacing space with nonBreakningSpace or space ASCII code - 32. */
private static string lineAndColumnClause = String.Join("|", new string[] {
"((\\S*) on line ((\\d+)(, column (\\d+))?))", // (file path) on line 8, column 13
"((\\S*):line ((\\d+)(, column (\\d+))?))", // (file path):line 8, column 13
"(([^\\s\\(\\)]*)(\\s?[\\(\\[](\\d+)(,\\s?(\\d+))?)[\\)\\]])", // (file path)(45), (file path) (45), (file path)(45,18), (file path) (45,18), (file path)(45, 18), (file path) (45, 18), also with []
"(([^:\\s\\(\\)<>\'\"\\[\\]]*)(:(\\d+))?(:(\\d+))?)" // (file path):336, (file path):336:9
}).Replace(" ", "[" + "\u00A0" + "]");
private static Regex localLinkPattern = new Regex(winLocalLinkClause + "(" + lineAndColumnClause + ")");
// Changing any regex may effect this value, hence changes this as well if required.
const int winLineAndColumnMatchIndex = 12;
const int unixLineAndColumnMatchIndex = 15;
// Each line and column clause have 6 groups (ie no. of expressions in round brackets)
const int lineAndColumnClauseGroupCount = 6;
#endregion
private JsonRpc rpc;
private TermWindowControl uiControl;
private Dispatcher ui;
public ScriptHelper(TermWindowControl uiControl, Stream serviceStream, Dispatcher ui)
{
this.rpc = JsonRpc.Attach(serviceStream, this);
this.uiControl = uiControl;
this.ui = ui;
}
public string GetSolutionDir()
{
IVsSolution solutionService = (IVsSolution)Package.GetGlobalService(typeof(SVsSolution));
solutionService.GetSolutionInfo(out string solutionDir, out _, out _);
if (solutionDir == null)
{
solutionDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
}
return solutionDir;
}
public void CopyStringToClipboard(string stringToCopy)
{
stringToCopy = stringToCopy == null ? "" : stringToCopy;
Clipboard.SetText(stringToCopy);
}
public string GetClipboard()
{
return Clipboard.GetText();
}
#region terminal controllers
public void TermData(string data)
{
rpc.InvokeAsync("termData", data);
}
public void InitTerm(int cols, int rows, string directory)
{
rpc.InvokeAsync("initTerm", TermWindowPackage.Instance?.OptionTerminal.ToString(), cols, rows, directory, TermWindowPackage.Instance?.OptionStartupArgument);
}
public void ResizeTerm(int cols, int rows)
{
rpc.InvokeAsync("resizeTerm", cols, rows);
}
public void PtyData(string data)
{
ui.InvokeAsync(() =>
{
this.uiControl.terminalView.Invoke("invokeTerm", "ptyData", data);
});
}
public void ReInitTerm(int? code)
{
ui.InvokeAsync(() =>
{
this.uiControl.terminalView.Invoke("invokeTerm", "reInitTerm", code);
});
}
#endregion
#region error link helpers
public string GetLinkRegex()
{
return localLinkPattern.ToString();
}
public void HandleLocalLink(string link)
{
var url = this.ExtractLinkUrl(link);
var path = this.PreprocessPath(url);
var lcinfo = this.ExtractLineColumnInfo(link);
VsShellUtilities.OpenDocument(TermWindowPackage.Instance, path, Guid.Empty, out _, out _, out _, out var textView);
if (textView != null)
{
// Indexing in an IVsTextView is zero-based, whereas values returned from a build should be one-based.
textView.SetCaretPos(lcinfo.Item1 - 1, lcinfo.Item2 - 1);
textView.CenterLines(lcinfo.Item1 - 1, 1);
textView.SendExplicitFocus();
}
}
public bool ValidateLocalLink(string link)
{
var url = this.ExtractLinkUrl(link);
if (url == null)
{
return false;
}
var path = this.PreprocessPath(url);
if (link == null)
{
return false;
}
return File.Exists(path);
}
private string PreprocessPath(string path)
{
// resolve ~
if (path[0] == '~')
{
var homeDrive = Environment.GetEnvironmentVariable("HOMEDRIVE");
var homePath = Environment.GetEnvironmentVariable("HOMEPATH");
if (homeDrive == null || homePath == null)
{
return null;
}
path = homeDrive + "\\" + homePath + path.Substring(1);
}
// resolve relative links
var regex = new Regex("^[a-zA-Z]:");
if (!regex.IsMatch(path))
{
IVsSolution solutionService = (IVsSolution)Package.GetGlobalService(typeof(SVsSolution));
solutionService.GetSolutionInfo(out string solutionDir, out _, out _);
if (solutionDir == null)
{
return null;
}
path = Path.Combine(solutionDir, path);
}
return path;
}
private string ExtractLinkUrl(string link)
{
var groups = localLinkPattern.Match(link).Groups;
if (groups.Count == 0)
{
return null;
}
return groups[1].ToString();
}
private Tuple<int, int> ExtractLineColumnInfo(string link)
{
var row = 0;
var col = 0;
var groups = localLinkPattern.Match(link).Groups;
for (var i = 0; i < lineAndColumnClause.Length; i++)
{
var lineMatchIndex = winLineAndColumnMatchIndex + (lineAndColumnClauseGroupCount * i);
var rowNumber = groups[lineMatchIndex].ToString();
if (rowNumber != "")
{
row = int.Parse(rowNumber);
var colNumber = groups[lineMatchIndex + 2].ToString();
if (colNumber != "")
{
col = int.Parse(colNumber);
}
break;
}
}
return new Tuple<int, int>(row, col);
}
#endregion
}
}

Просмотреть файл

@ -1,51 +0,0 @@
using Microsoft.VisualStudio.Shell;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace EmbeddedTerminal
{
public class TerminalOptionPage : DialogPage
{
private DefaultTerminal term = DefaultTerminal.Powershell;
string customCSSPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "view\\custom.css").Replace("\\\\", "\\");
string startupArgument = string.Empty;
[Category("Whack Whack Terminal")]
[DisplayName("Default Shell")]
public DefaultTerminal OptionTerminal
{
get { return term; }
set { term = value; }
}
[Category("Whack Whack Terminal")]
[DisplayName("Custom CSS File")]
public string CustomCSSPath
{
get { return customCSSPath; }
set { customCSSPath = value; }
}
[Category("Whack Whack Terminal")]
[DisplayName("Startup Argument")]
public string StartupArgument
{
get { return startupArgument; }
set { startupArgument = value; }
}
}
public enum DefaultTerminal
{
Powershell,
CMD,
WSLBash
}
}

26
EmbeddedTerminal/package-lock.json сгенерированный
Просмотреть файл

@ -1,26 +0,0 @@
{
"name": "embeddedterminal",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"nan": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.5.0.tgz",
"integrity": "sha1-qo8eNFMdgH6eJ3VbI0tKbsDBUqg="
},
"node-pty": {
"version": "0.6.10",
"resolved": "https://registry.npmjs.org/node-pty/-/node-pty-0.6.10.tgz",
"integrity": "sha1-t9NVuyAC0W4Uw8NT5YxI9+4TGmc=",
"requires": {
"nan": "2.5.0"
}
},
"xterm": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/xterm/-/xterm-2.8.1.tgz",
"integrity": "sha512-AuqLOWpprmhSe4TcGE6Gh2uwkR0wUC95V0Q736OFUmG+84W+w+g6RzcgVhrbOTo/Fzcq9i0TRR5nYksRt2DSIQ=="
}
}
}

Просмотреть файл

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.ServiceHub.Client" version="1.0.226-rc" targetFramework="net46" />
<package id="Microsoft.VisualStudio.CoreUtility" version="15.0.26606" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Imaging" version="15.0.26606" targetFramework="net461" />
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6070" targetFramework="net461" />
<package id="Microsoft.VisualStudio.SDK.EmbedInteropTypes" version="15.0.9" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.15.0" version="15.0.26201" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Framework" version="15.0.26606" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop" version="7.10.6071" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop.10.0" version="10.0.30319" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop.11.0" version="11.0.61030" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop.12.0" version="12.0.30110" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime" version="15.0.26606" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop.8.0" version="8.0.50727" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop.9.0" version="9.0.30729" targetFramework="net461" />
<package id="Microsoft.VisualStudio.TextManager.Interop" version="7.10.6070" targetFramework="net461" />
<package id="Microsoft.VisualStudio.TextManager.Interop.8.0" version="8.0.50727" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Threading" version="15.2.5" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Utilities" version="15.0.26606" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Validation" version="15.0.82" targetFramework="net46" />
<package id="Microsoft.VSSDK.BuildTools" version="15.1.192" targetFramework="net461" developmentDependency="true" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net46" />
<package id="StreamJsonRpc" version="1.0.36" targetFramework="net46" />
</packages>

Просмотреть файл

@ -1,46 +0,0 @@
/**********************************************************************************************************************
* This file is provided as an example of how to modify the styling of the terminal. For a full CSS *
* Reference visit https://github.com/sourcelair/xterm.js/blob/2b92996d7c0c8a6f161c90cb96528858979a50fd/src/xterm.css. *
* Styling that is not set here will be controlled by the extension. *
* *
* Supported CSS Modifications: *
* - all color changes *
* - font size *
* - font family *
* *
* ANY OTHER CSS MODIFICATION ARE NOT SUPPORTED AND DONE AT YOUR OWN RISK *
***********************************************************************************************************************/
/* This class controls the default text color of the terminal */
.terminal {
color: default;
font-family: Consolas;
font-size: 12pt;
}
/* Can be used to control the background color of the terminal */
.terminal .xterm-viewport {
background-color: default;
}
/* This class can be used to modify the color of text selection in the terminal */
.terminal .xterm-selection div {
background-color: default;
}
/* Modifies the cursor. Note: the background color is the color of the cursor when it is "on" */
.terminal.focus:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar) .terminal-cursor {
background-color: default;
color: default;
}
/* Modifies the cursor when the terminal is not focused */
.terminal:not(.focus) .terminal-cursor {
outline-color: default;
}
/* This class is applied to text elements with the "15" color, xterm supports 256 different color values */
.terminal .xterm-color-15 {
color: default;
}

Просмотреть файл

@ -1,25 +0,0 @@
<!-- saved from url=(0016)http://localhost -->
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="utf-8" />
<title>Terminal Window</title>
<link rel="stylesheet" href="../node_modules/xterm/dist/xterm.css" />
<link rel="stylesheet" href="../node_modules/xterm/dist/addons/fullscreen/fullscreen.css" />
<link rel="stylesheet" href="default.css" data-plugin-theme="true" />
<script src="../node_modules/xterm/dist/xterm.js" type="text/javascript"></script>
<script src="../node_modules/xterm/dist/addons/fit/fit.js" type="text/javascript"></script>
<script src="../node_modules/xterm/dist/addons/fullscreen/fullscreen.js" type="text/javascript"></script>
</head>
<body>
<div id="content" style="height: 100%">
</div>
<div id="debug">
debug:
</div>
<script src="linkMatcher.js" type="text/javascript"></script>
<script src="default.js" type="text/javascript"></script>
</body>
</html>

Просмотреть файл

@ -1,127 +0,0 @@
var termView;
function TermView() {
this.resizeTimeout = null;
this.term = new Terminal({
cursorBlink: true,
cols: 80,
rows: 24
});
this.term.open(document.getElementById('content'));
this.term.fit();
this.term.on('data', this.termData.bind(this));
window.addEventListener("resize", this.resizeHandler.bind(this), false);
this.initTerm();
this.registerKeyboardHandlers();
registerLinkMatcher(this.term);
}
TermView.prototype.solutionDir = function () {
return window.external.GetSolutionDir();
}
TermView.prototype.copyString = function (stringToCopy) {
window.external.CopyStringToClipboard(stringToCopy);
}
TermView.prototype.getClipboard = function () {
return window.external.GetClipboard();
}
TermView.prototype.ptyData = function (data) {
this.term.write(data);
}
TermView.prototype.initTerm = function () {
var term = this.term;
window.external.InitTerm(term.cols, term.rows, this.solutionDir());
}
TermView.prototype.reInitTerm = function (code) {
if (code != null) {
this.term.write('terminal exited with code: ' + code + ', restarting the terminal\n\r');
} else {
this.term.write('terminal was exited, restarting terminal instance\n\r');
}
this.initTerm();
}
TermView.prototype.termData = function (data) {
window.external.TermData(data);
}
TermView.prototype.focus = function() {
this.term.focus();
}
TermView.prototype.resizeHandler = function () {
var term = this.term;
var actualHandler = function () {
term.fit();
window.external.ResizeTerm(term.cols, term.rows);
};
var timeoutCallBack = function () {
this.resizeTimeout = null;
actualHandler();
}
// ignore resize events as long as an actualResizeHandler execution is in the queue
if (!this.resizeTimeout) {
this.resizeTimeout = setTimeout(timeoutCallBack.bind(this), 66);
}
}
TermView.prototype.registerKeyboardHandlers = function () {
var term = this.term;
var copy = this.copyString.bind(this);
var getClipboard = this.getClipboard.bind(this);
var termData = this.termData.bind(this);
term.attachCustomKeyEventHandler(function (event) {
// capture Ctrl+C
if (event.ctrlKey && event.keyCode == 67 && term.hasSelection()) {
copy(term.getSelection());
term.clearSelection();
return false;
// capture Ctrl+V
} else if (event.ctrlKey && event.keyCode == 86) {
return false;
}
return true;
});
window.addEventListener('contextmenu', function (event) {
if (term.hasSelection()) {
copy(term.getSelection());
term.clearSelection();
} else {
var content = getClipboard()
termData(content);
}
});
}
function getMethods(obj) {
var result = [];
for (var id in obj) {
try {
result.push(id + '\n');
} catch (err) {
result.push(id + ": inaccessible");
}
}
return result;
}
function invokeTerm(method, arg) {
termView[method](arg);
}
document.addEventListener("DOMContentLoaded", function (event) {
termView = new TermView();
});

Просмотреть файл

@ -1,35 +0,0 @@
function registerLinkMatcher(xterm) {
const LOCAL_LINK_PRIORITY = -2;
function TerminalLinkHandler(terminal) {
this.terminal = terminal;
this.localLinkRegex = new RegExp(window.external.GetLinkRegex());
}
TerminalLinkHandler.prototype.registerLocalLinkHandler = function() {
return this.terminal.registerLinkMatcher(this.localLinkRegex, this.handleLocalLink.bind(this), {
validationCallback: this.validateLocalLink.bind(this),
priority: LOCAL_LINK_PRIORITY
});
}
TerminalLinkHandler.prototype.handleLocalLink = function(event, uri) {
// We call the handle function on a small timeout to cause it to happen after the click event has fully
// propogated. This ensures that focus properly transfers to the editor.
setTimeout(function() { window.external.HandleLocalLink(uri); }, 1);
event.preventDefault();
}
TerminalLinkHandler.prototype.validateLocalLink = function (link, element, callback) {
document.getElementById("debug").innerText = "" + link + callback;
if (window.external.ValidateLocalLink(link)) {
callback(true);
} else {
callback(false);
}
}
var linkHandler = new TerminalLinkHandler(xterm);
linkHandler.registerLocalLinkHandler();
}

Просмотреть файл

@ -0,0 +1,45 @@
using System;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
namespace Microsoft.VisualStudio.Terminal
{
/// <summary>
/// Handle to a specific terminal instance.
/// </summary>
[ComImport, Guid("E195D61C-2821-49F1-BE0E-B2CD82F1F856")]
public interface ITerminal
{
/// <summary>
/// Shows the terminal window.
/// </summary>
/// <returns>A <see cref="Task"/> that completes once the tool window has been shown.</returns>
Task ShowAsync();
/// <summary>
/// Hides the terminal window.
/// </summary>
/// <returns>A <see cref="Task"/> that completes once the tool window has been hidden.</returns>
Task HideAsync();
/// <summary>
/// Closes the terminal window and destroys the underlying terminal instance.
/// It is considered an error to call any methods on this object after close has been called.
/// </summary>
/// <returns>A <see cref="Task"/> that completes once the tool window has been closed.</returns>
Task CloseAsync();
/// <summary>
/// Changes the current working directory of the terminal. Note that this will restart the backend process
/// so any running tasks will be killed.
/// </summary>
/// <param name="newDirectory">The directory to switch the terminal to.</param>
/// <returns>A <see cref="Task"/> that completes once the terminal has switched directories.</returns>
Task ChangeWorkingDirectoryAsync(string newDirectory);
/// <summary>
/// An event that is fired when the terminal closes.
/// </summary>
event EventHandler Closed;
}
}

Просмотреть файл

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
namespace Microsoft.VisualStudio.Terminal
{
[ComImport, Guid("0A251003-6B81-4441-A00F-FB1FC45DB09B")]
public interface ITerminalService
{
/// <summary>
/// Create a new hidden terminal instance with the given options.
/// </summary>
/// <param name="name">The name that will be displayed as the tool window title.</param>
/// <param name="shellPath">The path to the executable that will be launched. If the value is null the default shell set in the options will be used.</param>
/// <param name="workingDirectory">Directory that the shell should start in.</param>
/// <param name="args">Arguments to pass to the shell on the command line. If the value is null the default startup arguments set in the options will be used.</param>
/// <param name="environment">Extra environment variables to set, this is additive only.</param>
/// <returns></returns>
Task<object> CreateTerminalAsync(string name, string shellPath, string workingDirectory, IEnumerable<string> args, IDictionary<string, string> environment);
}
}

Двоичные данные
Microsoft.VisualStudio.Terminal.Embeddable/Key.snk Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>0.0.0.0</Version>
<Authors>Daniel Griffen</Authors>
<Company />
<Description>Interop types for WhackWhackTerminal service</Description>
<Copyright>Copyright © Microsoft Corporation</Copyright>
<PackageLicenseUrl>https://raw.githubusercontent.com/Microsoft/WhackWhackTerminal/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/Microsoft/WhackWhackTerminal</PackageProjectUrl>
<PackageTags>WhackWhackTerminal VisualStudio Terminal</PackageTags>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<FileVersion>0.0.0.0</FileVersion>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<Content Include="Microsoft.VisualStudio.Terminal.Embeddable.targets">
<PackagePath>build</PackagePath>
<Pack>true</Pack>
</Content>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- See https://github.com/NuGet/Home/issues/2365 for more info.
The decision whether an assembly needs to be linked or referenced belongs to the package author.
It's very important that you make this target name as unique as possible to avoid clashes. Ideally you would include both your package name and the assembly being embedded in the name.
-->
<Target Name="Embedding_MicrosoftVisualStudioTerminalEmbeddable_Target" AfterTargets="ResolveReferences" BeforeTargets="FindReferenceAssembliesForReferences">
<PropertyGroup>
<_InteropAssemblyFileName>Microsoft.VisualStudio.Terminal.Embeddable</_InteropAssemblyFileName>
</PropertyGroup>
<!-- This target will set the EmbedInteropTypes metadata for the _InteropAssemblyFileName value in the current package. In order for a target to be executed in NuGet, the target name should be the same as the package id.-->
<ItemGroup>
<ReferencePath Condition=" '%(FileName)' == '$(_InteropAssemblyFileName)' AND '%(ReferencePath.NuGetPackageId)' == '$(MSBuildThisFileName)' ">
<EmbedInteropTypes>true</EmbedInteropTypes>
</ReferencePath>
</ItemGroup>
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,11 @@
using System.Runtime.InteropServices;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4befdab9-7266-43d6-8089-7723865aa483")]
[assembly: ImportedFromTypeLib("Microsoft.VisualStudio.Terminal.Embeddable")]

Просмотреть файл

@ -0,0 +1,10 @@
using System;
using System.Runtime.InteropServices;
namespace Microsoft.VisualStudio.Terminal
{
[ComImport, Guid("BA8EB030-CDE7-4377-8B42-A7FB400FDD84")]
public interface STerminalService
{
}
}

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 1.6 KiB

После

Ширина:  |  Высота:  |  Размер: 1.6 KiB

Просмотреть файл

@ -1,26 +1,11 @@
using Microsoft.VisualStudio.PlatformUI;
using Microsoft.VisualStudio.Shell;
using mshtml;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace EmbeddedTerminal
namespace Microsoft.VisualStudio.Terminal
{
/// <summary>
@ -28,38 +13,22 @@ namespace EmbeddedTerminal
/// </summary>
public class BetterBrowser : ContentControl
{
[DllImport("urlmon.dll")]
[PreserveSig]
[return: MarshalAs(UnmanagedType.Error)]
static extern int CoInternetSetFeatureEnabled(int FeatureEntry, uint dwFlags, [MarshalAs(UnmanagedType.Bool)]bool fEnable);
public static readonly DependencyProperty CustomCSSProperty = DependencyProperty.Register(
"CustomCSS", typeof(IList), typeof(BetterBrowser), new PropertyMetadata(new List<CustomCSSRule>()));
public IList CustomCSS
{
get { return (IList)GetValue(CustomCSSProperty); }
set { SetValue(CustomCSSProperty, value); }
}
public object ScriptingObject
{
get { return this.browser.ObjectForScripting; }
set { this.browser.ObjectForScripting = value; }
}
private System.Windows.Forms.WebBrowser browser;
private IHTMLStyleSheet styleSheet;
public BetterBrowser()
{
this.CustomCSS = new List<CustomCSSRule>();
System.Windows.Forms.Integration.WindowsFormsHost host =
new System.Windows.Forms.Integration.WindowsFormsHost();
this.browser = new System.Windows.Forms.WebBrowser();
this.browser.ScriptErrorsSuppressed = true;
browser.WebBrowserShortcutsEnabled = true;
browser.PreviewKeyDown += Browser_PreviewKeyDown;
this.browser.DocumentCompleted += Browser_DocumentCompleted;
@ -112,25 +81,13 @@ namespace EmbeddedTerminal
var doc = (IHTMLDocument2)browser.Document.DomDocument;
this.styleSheet = doc.createStyleSheet("themesheet.css");
doc.createStyleSheet(TermWindowPackage.Instance?.OptionCustomCSSPath??"");
this.ThemeStyleSheet();
}
private void ThemeStyleSheet()
{
this.styleSheet.cssText = "";
// First we add the default rules
this.styleSheet.addRule("body", CompileDefaultRules());
foreach (CustomCSSRule item in CustomCSS)
{
string declarationSegment = String.Empty;
foreach (CSSDeclaration declaration in item.Declarations)
{
declarationSegment += declaration.ToString();
}
this.styleSheet.addRule(item.Selector, declarationSegment);
}
}
private string CompileDefaultRules()
@ -143,74 +100,5 @@ namespace EmbeddedTerminal
declarationSegment += "scrollbar-face-color: " + ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(EnvironmentColors.ScrollBarThumbBackgroundColorKey)) + ";";
return declarationSegment;
}
}
public class CustomCSSRule : DependencyObject
{
public string Selector
{
get;
set;
}
public static readonly DependencyProperty DeclarationsProperty = DependencyProperty.Register(
"Declarations", typeof(IList), typeof(CustomCSSRule), new PropertyMetadata(new List<CSSDeclaration>()));
public IList Declarations
{
get { return (IList)GetValue(DeclarationsProperty); }
set { SetValue(DeclarationsProperty, value); }
}
public CustomCSSRule()
{
this.Declarations = new List<CSSDeclaration>();
}
}
public class CSSDeclaration: DependencyObject
{
public CSSProperty Attribute
{
get;
set;
}
public ThemeResourceKey Value
{
get;
set;
}
public override string ToString()
{
var color = ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(this.Value));
string property;
switch (this.Attribute)
{
case CSSProperty.Color:
property = "color";
break;
case CSSProperty.BackgroundColor:
property = "background-color";
break;
case CSSProperty.OutlineColor:
property = "outline-color";
break;
default:
return "";
}
return property + ": " + color + ";";
}
public enum CSSProperty
{
Color,
BackgroundColor,
OutlineColor
}
}
}

Просмотреть файл

@ -0,0 +1,19 @@
namespace Microsoft.VisualStudio.Terminal
{
internal interface ITerminalScriptingObject
{
string GetTheme();
string GetFontFamily();
int GetFontSize();
string GetSolutionDir();
void InitPty(int cols, int rows, string directory);
void ClosePty();
void CopyStringToClipboard(string stringToCopy);
string GetClipboard();
void TermData(string data);
void ResizePty(int cols, int rows);
string GetLinkRegex();
void HandleLocalLink(string uri);
bool ValidateLocalLink(string link);
}
}

Просмотреть файл

@ -0,0 +1,32 @@
namespace Microsoft.VisualStudio.Terminal
{
using Microsoft.VisualStudio.PlatformUI;
using StreamJsonRpc;
using System.Threading.Tasks;
internal class TerminalEvent
{
private readonly TermWindowPackage package;
private readonly BetterBrowser browser;
public TerminalEvent(TermWindowPackage package, BetterBrowser browser, SolutionUtils solutionUtils)
{
this.package = package;
this.browser = browser;
}
[JsonRpcMethod("PtyData")]
public async Task PtyDataAsync(string data)
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
this.browser.Invoke("triggerEvent", "ptyData", data);
}
[JsonRpcMethod("PtyExit")]
public async Task PtyExitAsync(int? code)
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
this.browser.Invoke("triggerEvent", "ptyExited", code);
}
}
}

Просмотреть файл

@ -0,0 +1,147 @@
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using System;
using System.IO;
using System.Text.RegularExpressions;
namespace Microsoft.VisualStudio.Terminal
{
internal static class TerminalRegex
{
/* Regex's originally from VSCode.
* VSCode is licensed under the MIT license, original sources and license.txt can be found here:
* https://github.com/Microsoft/vscode
*/
const string winDrivePrefix = "[a-zA-Z]:";
const string winPathPrefix = "(" + winDrivePrefix + "|\\.\\.?|\\~)";
const string winPathSeparatorClause = "(\\\\|\\/)";
const string winExcludedPathCharactersClause = "[^\\0<>\\?\\|\\/\\s!$`&*()\\[\\]+\'\":;]";
/** A regex that matches paths in the form c:\foo, ~\foo, .\foo, ..\foo, foo\bar */
const string winLocalLinkClause = "((" + winPathPrefix + "|(" + winExcludedPathCharactersClause + ")+)?(" + winPathSeparatorClause + "(" + winExcludedPathCharactersClause + ")+)+)";
/** As xterm reads from DOM, space in that case is nonbreaking char ASCII code - 160,
replacing space with nonBreakningSpace or space ASCII code - 32. */
private static string lineAndColumnClause = String.Join("|", new string[] {
"((\\S*) on line ((\\d+)(, column (\\d+))?))", // (file path) on line 8, column 13
"((\\S*):line ((\\d+)(, column (\\d+))?))", // (file path):line 8, column 13
"(([^\\s\\(\\)]*)(\\s?[\\(\\[](\\d+)(,\\s?(\\d+))?)[\\)\\]])", // (file path)(45), (file path) (45), (file path)(45,18), (file path) (45,18), (file path)(45, 18), (file path) (45, 18), also with []
"(([^:\\s\\(\\)<>\'\"\\[\\]]*)(:(\\d+))?(:(\\d+))?)" // (file path):336, (file path):336:9
}).Replace(" ", "[" + "\u00A0" + "]");
private static Regex localLinkPattern = new Regex(winLocalLinkClause + "(" + lineAndColumnClause + ")");
// Changing any regex may effect this value, hence changes this as well if required.
const int winLineAndColumnMatchIndex = 12;
const int unixLineAndColumnMatchIndex = 15;
// Each line and column clause have 6 groups (ie no. of expressions in round brackets)
const int lineAndColumnClauseGroupCount = 6;
public static Regex LocalLinkRegex => localLinkPattern;
public static bool ValidateLocalLink(string link)
{
var url = ExtractLinkUrl(link);
if (url == null)
{
return false;
}
var path = PreprocessPath(url);
if (link == null)
{
return false;
}
return File.Exists(path);
}
public static void HandleLocalLink(string uri)
{
var url = ExtractLinkUrl(uri);
var path = PreprocessPath(url);
var lcinfo = ExtractLineColumnInfo(uri);
VsShellUtilities.OpenDocument(ServiceProvider.GlobalProvider, path, Guid.Empty, out _, out _, out _, out var textView);
if (textView != null)
{
// Indexing in an IVsTextView is zero-based, whereas values returned from a build should be one-based.
textView.SetCaretPos(lcinfo.Item1 - 1, lcinfo.Item2 - 1);
textView.CenterLines(lcinfo.Item1 - 1, 1);
textView.SendExplicitFocus();
}
}
private static string PreprocessPath(string path)
{
ThreadHelper.ThrowIfNotOnUIThread();
// resolve ~
if (path[0] == '~')
{
var homeDrive = Environment.GetEnvironmentVariable("HOMEDRIVE");
var homePath = Environment.GetEnvironmentVariable("HOMEPATH");
if (homeDrive == null || homePath == null)
{
return null;
}
path = homeDrive + "\\" + homePath + path.Substring(1);
}
// resolve relative links
var regex = new Regex("^[a-zA-Z]:");
if (!regex.IsMatch(path))
{
IVsSolution solutionService = (IVsSolution)Package.GetGlobalService(typeof(SVsSolution));
solutionService.GetSolutionInfo(out string solutionDir, out _, out _);
if (solutionDir == null)
{
return null;
}
path = Path.Combine(solutionDir, path);
}
return path;
}
private static string ExtractLinkUrl(string link)
{
var groups = localLinkPattern.Match(link).Groups;
if (groups.Count == 0)
{
return null;
}
return groups[1].ToString();
}
private static Tuple<int, int> ExtractLineColumnInfo(string link)
{
var row = 0;
var col = 0;
var groups = localLinkPattern.Match(link).Groups;
for (var i = 0; i < lineAndColumnClause.Length; i++)
{
var lineMatchIndex = winLineAndColumnMatchIndex + (lineAndColumnClauseGroupCount * i);
var rowNumber = groups[lineMatchIndex].ToString();
if (rowNumber != "")
{
row = int.Parse(rowNumber);
var colNumber = groups[lineMatchIndex + 2].ToString();
if (colNumber != "")
{
col = int.Parse(colNumber);
}
break;
}
}
return new Tuple<int, int>(row, col);
}
}
}

Просмотреть файл

@ -0,0 +1,119 @@
using Microsoft.VisualStudio.Shell;
using StreamJsonRpc;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Windows;
namespace Microsoft.VisualStudio.Terminal
{
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
[ComVisible(true)]
public class TerminalScriptingObject : ITerminalScriptingObject
{
private readonly TermWindowPackage package;
private readonly JsonRpc ptyService;
private readonly SolutionUtils solutionUtils;
private readonly string workingDirectory;
private readonly bool useSolutionDir;
private readonly string shellPath;
private readonly IEnumerable<string> args;
private readonly IDictionary<string, string> env;
internal TerminalScriptingObject(
TermWindowPackage package,
JsonRpc ptyService,
SolutionUtils solutionUtils,
string workingDirectory,
bool useSolutionDir,
string shellPath,
IEnumerable<string> args,
IDictionary<string, string> env)
{
this.package = package;
this.ptyService = ptyService;
this.solutionUtils = solutionUtils;
this.workingDirectory = workingDirectory;
this.useSolutionDir = useSolutionDir;
this.shellPath = shellPath;
this.args = args;
this.env = env;
}
public string GetTheme()
{
return TerminalThemer.GetTheme();
}
public string GetFontFamily()
{
return this.package.OptionFontFamily;
}
public int GetFontSize()
{
return this.package.OptionFontSize;
}
public string GetSolutionDir()
{
if (!this.useSolutionDir)
{
return this.workingDirectory;
}
var solutionDir = this.solutionUtils.GetSolutionDir();
if (solutionDir == null)
{
solutionDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
}
return solutionDir;
}
public void ClosePty()
{
this.ptyService.InvokeAsync("closeTerm");
}
public void CopyStringToClipboard(string stringToCopy)
{
Clipboard.SetText(stringToCopy ?? "");
}
public string GetClipboard()
{
return Clipboard.GetText();
}
public string GetLinkRegex()
{
return TerminalRegex.LocalLinkRegex.ToString();
}
public void HandleLocalLink(string uri)
{
TerminalRegex.HandleLocalLink(uri);
}
public void InitPty(int cols, int rows, string directory)
{
this.ptyService.InvokeAsync("initTerm", this.shellPath ?? this.package.OptionTerminal.ToString(), cols, rows, directory, ((object)this.args) ?? this.package.OptionStartupArgument, env).FileAndForget("WhackWhackTerminal/InitPty");
}
public void ResizePty(int cols, int rows)
{
this.ptyService.InvokeAsync("resizeTerm", cols, rows).FileAndForget("WhackWhackTerminal/ResizePty");
}
public void TermData(string data)
{
this.ptyService.InvokeAsync("termData", data).FileAndForget("WhackWhackTerminal/TermData");
}
public bool ValidateLocalLink(string link)
{
return TerminalRegex.ValidateLocalLink(link);
}
}
}

Просмотреть файл

@ -0,0 +1,141 @@
using System.Runtime.Serialization;
namespace Microsoft.VisualStudio.Terminal
{
[DataContract]
public class TerminalTheme
{
[DataMember(Name = "foreground")]
public string Foreground
{
get;
set;
}
[DataMember(Name = "background")]
public string Background
{
get;
set;
}
[DataMember(Name = "cursor")]
public string Cursor
{
get;
set;
}
[DataMember(Name = "black")]
public string Black
{
get;
set;
}
[DataMember(Name = "red")]
public string Red
{
get;
set;
}
[DataMember(Name = "green")]
public string Green
{
get;
set;
}
[DataMember(Name = "yellow")]
public string Yellow
{
get;
set;
}
[DataMember(Name = "blue")]
public string Blue
{
get;
set;
}
[DataMember(Name = "magenta")]
public string Magenta
{
get;
set;
}
[DataMember(Name = "cyan")]
public string Cyan
{
get;
set;
}
[DataMember(Name = "white")]
public string White
{
get;
set;
}
[DataMember(Name = "brightBlack")]
public string BrightBlack
{
get;
set;
}
[DataMember(Name = "brightRed")]
public string BrightRed
{
get;
set;
}
[DataMember(Name = "brightGreen")]
public string BrightGreen
{
get;
set;
}
[DataMember(Name = "brightYellow")]
public string BrightYellow
{
get;
set;
}
[DataMember(Name = "brightBlue")]
public string BrightBlue
{
get;
set;
}
[DataMember(Name = "brightMagenta")]
public string BrightMagenta
{
get;
set;
}
[DataMember(Name = "brightCyan")]
public string BrightCyan
{
get;
set;
}
[DataMember(Name = "brightWhite")]
public string BrightWhite
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,69 @@
using Microsoft.VisualStudio.PlatformUI;
using Newtonsoft.Json;
using System.Drawing;
namespace Microsoft.VisualStudio.Terminal
{
internal static class TerminalThemer
{
private static readonly TerminalTheme DarkTheme = new TerminalTheme()
{
Cursor = "#ffffff",
Black = "#000000",
Red = "#cd3131",
Green = "#0dbc79",
Yellow = "#e5e510",
Blue = "2472c8",
Magenta = "#bc3fbc",
Cyan = "#11a8cd",
White = "#e5e5e5",
BrightBlack = "#666666",
BrightRed = "#f14c4c",
BrightGreen = "#23d18b",
BrightYellow = "#f5f543",
BrightBlue = "3b8eea",
BrightMagenta = "#d670d6",
BrightCyan = "#29b8db",
BrightWhite = "#e5e5e5",
};
private static readonly TerminalTheme LightTheme = new TerminalTheme()
{
Cursor = "#ffffff",
Black = "#000000",
Red = "#cd3131",
Green = "#00BC00",
Yellow = "#949800",
Blue = "0451a5",
Magenta = "#bc05bc",
Cyan = "#0598bc",
White = "#555555",
BrightBlack = "#666666",
BrightRed = "#cd3131",
BrightGreen = "#14CE14",
BrightYellow = "#b5ba00",
BrightBlue = "0451a5",
BrightMagenta = "#bc05bc",
BrightCyan = "#0598bc",
BrightWhite = "#a5a5a5",
};
public static string GetTheme()
{
TerminalTheme theme;
if (VSColorTheme.GetThemedColor(EnvironmentColors.ToolboxBackgroundColorKey).GetBrightness() < 0.5)
{
theme = DarkTheme;
}
else
{
theme = LightTheme;
}
theme.Background = ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(EnvironmentColors.ToolboxBackgroundColorKey));
theme.Foreground = ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(EnvironmentColors.ToolboxContentTextColorKey));
theme.Cursor = ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(EnvironmentColors.ToolboxContentTextColorKey));
return JsonConvert.SerializeObject(theme);
}
}
}

Просмотреть файл

Просмотреть файл

@ -0,0 +1,413 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.props')" />
<Import Project="..\packages\Microsoft.TypeScript.MSBuild.2.7.1\build\Microsoft.TypeScript.MSBuild.props" Condition="Exists('..\packages\Microsoft.TypeScript.MSBuild.2.7.1\build\Microsoft.TypeScript.MSBuild.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<UseCodebase>true</UseCodebase>
<TargetFrameworkProfile />
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
<TypeScriptModuleResolution>Node</TypeScriptModuleResolution>
<TypeScriptToolsVersion>2.6</TypeScriptToolsVersion>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{ED2D97CC-2A98-48D4-AE1F-2277CB987C04}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.VisualStudio.Terminal</RootNamespace>
<AssemblyName>WhackWhackTerminal</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<StartAction>Program</StartAction>
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootsuffix Exp</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptJSXEmit>None</TypeScriptJSXEmit>
<TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
<TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
<TypeScriptRemoveComments>False</TypeScriptRemoveComments>
<TypeScriptOutFile />
<TypeScriptOutDir>bin\Debug\js</TypeScriptOutDir>
<TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
<TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
<TypeScriptSourceMap>True</TypeScriptSourceMap>
<TypeScriptMapRoot />
<TypeScriptSourceRoot />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptJSXEmit>None</TypeScriptJSXEmit>
<TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
<TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
<TypeScriptRemoveComments>true</TypeScriptRemoveComments>
<TypeScriptOutFile />
<TypeScriptOutDir>bin\Release\js</TypeScriptOutDir>
<TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
<TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
<TypeScriptSourceMap>False</TypeScriptSourceMap>
<TypeScriptMapRoot />
<TypeScriptSourceRoot />
</PropertyGroup>
<ItemGroup>
<Compile Include="BrowserBridge\BetterBrowser.cs" />
<Compile Include="BrowserBridge\ITerminalScriptingObject.cs" />
<Compile Include="BrowserBridge\TerminalRegex.cs" />
<Compile Include="BrowserBridge\TerminalScriptingObject.cs" />
<Compile Include="BrowserBridge\TerminalEvent.cs" />
<Compile Include="BrowserBridge\TerminalThemer.cs" />
<Compile Include="ServiceToolWindow.cs" />
<Compile Include="ServiceToolWindowControl.xaml.cs">
<DependentUpon>ServiceToolWindowControl.xaml</DependentUpon>
</Compile>
<Compile Include="VsService\EmbeddedTerminal.cs" />
<Compile Include="VsService\EmbeddedTerminalService.cs" />
<Compile Include="BrowserBridge\TerminalTheme.cs" />
<Compile Include="Options\OptionItemAttribute.cs" />
<Compile Include="Options\OptionsModel.cs" />
<Compile Include="Options\TerminalOptionsModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Options\TerminalOptionPage.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="SolutionUtils.cs" />
<Compile Include="TermWindow.cs" />
<Compile Include="TermWindowCommand.cs" />
<Compile Include="TermWindowControl.xaml.cs">
<DependentUpon>TermWindowControl.xaml</DependentUpon>
</Compile>
<Compile Include="TermWindowPackage.cs" />
<Compile Include="ToolWindowContext.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="BrandWhackWhackTerminal_256x.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="WebView\default.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="ServiceHub\pty.js">
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="Key.snk" />
<Content Include="ServiceHub\wwt.pty.servicehub.service.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="package-lock.json" />
<None Include="package.json" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="WebView\default.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<VSCTCompile Include="TermWindowPackage.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<SubType>Designer</SubType>
</VSCTCompile>
</ItemGroup>
<ItemGroup>
<Page Include="ServiceToolWindowControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="TermWindowControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.ServiceHub.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.ServiceHub.Client.1.0.226-rc\lib\net46\Microsoft.ServiceHub.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.CommandBars, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.CoreUtility.15.6.27413\lib\net45\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.ImageCatalog, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.ImageCatalog.15.6.27413\lib\net45\Microsoft.VisualStudio.ImageCatalog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Imaging, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Imaging.15.6.27413\lib\net45\Microsoft.VisualStudio.Imaging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.14.3.25407\lib\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6071\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.15.0.15.6.27413\lib\net45\Microsoft.VisualStudio.Shell.15.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Framework.15.6.27413\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6072\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30320\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61031\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30110\lib\Microsoft.VisualStudio.Shell.Interop.12.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.14.3.25407\lib\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.15.0.26929\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.15.6.27413\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30730\lib\net11\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Text.Data.15.6.27413\lib\net45\Microsoft.VisualStudio.Text.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6071\lib\net11\Microsoft.VisualStudio.TextManager.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Threading, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Threading.15.6.31\lib\net46\Microsoft.VisualStudio.Threading.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Utilities.15.6.27413\lib\net46\Microsoft.VisualStudio.Utilities.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Validation.15.3.15\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Workspace, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Workspace.15.0.401\lib\net46\Microsoft.VisualStudio.Workspace.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Workspace.Extensions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Workspace.15.0.401\lib\net46\Microsoft.VisualStudio.Workspace.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Workspace.Extensions.VS, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Workspace.15.0.401\lib\net46\Microsoft.VisualStudio.Workspace.Extensions.VS.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Workspace.VSIntegration.Contracts, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Workspace.VSIntegration.15.0.401\lib\net46\Microsoft.VisualStudio.Workspace.VSIntegration.Contracts.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="StreamJsonRpc, Version=1.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\StreamJsonRpc.1.3.23\lib\net45\StreamJsonRpc.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<SuppressFromVsix Include="Microsoft.ServiceHub.Client.dll">
<InProject>false</InProject>
</SuppressFromVsix>
<SuppressFromVsix Include="Microsoft.VisualStudio.Workspace.dll">
<InProject>false</InProject>
</SuppressFromVsix>
<SuppressFromVsix Include="Microsoft.VisualStudio.Workspace.Extensions.dll">
<InProject>false</InProject>
</SuppressFromVsix>
<SuppressFromVsix Include="Microsoft.VisualStudio.Workspace.Extensions.VS.dll">
<InProject>false</InProject>
</SuppressFromVsix>
<SuppressFromVsix Include="Microsoft.VisualStudio.Workspace.VSIntegration.Contracts.dll">
<InProject>false</InProject>
</SuppressFromVsix>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="VSPackage.resx">
<MergeWithCTO>true</MergeWithCTO>
<ManifestResourceName>VSPackage</ManifestResourceName>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<TypeScriptCompile Include="WebView\ts\external.d.ts" />
<TypeScriptCompile Include="WebView\ts\main.ts" />
<TypeScriptCompile Include="WebView\ts\TerminalLinkMatcher.ts" />
<TypeScriptCompile Include="WebView\ts\TermView.ts" />
<TypeScriptCompile Include="WebView\ts\VsEventManager.ts" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.6.31\analyzers\cs\Microsoft.VisualStudio.Threading.Analyzers.dll" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.VisualStudio.Terminal.Embeddable\Microsoft.VisualStudio.Terminal.Embeddable.csproj">
<Project>{4befdab9-7266-43d6-8089-7723865aa483}</Project>
<Name>Microsoft.VisualStudio.Terminal.Embeddable</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.TypeScript.MSBuild.2.7.1\build\Microsoft.TypeScript.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.TypeScript.MSBuild.2.7.1\build\Microsoft.TypeScript.MSBuild.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.TypeScript.MSBuild.2.7.1\build\Microsoft.TypeScript.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.TypeScript.MSBuild.2.7.1\build\Microsoft.TypeScript.MSBuild.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.TypeScript.MSBuild.2.7.1\build\Microsoft.TypeScript.MSBuild.targets" Condition="Exists('..\packages\Microsoft.TypeScript.MSBuild.2.7.1\build\Microsoft.TypeScript.MSBuild.targets')" />
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.targets')" />
<Target Name="AddTsToContent" AfterTargets="CompileTypeScript" Condition="'$(BuildingProject)' != 'false'">
<ItemGroup>
<Content Include="@(GeneratedJavascript)">
<IncludeInVSIX>true</IncludeInVSIX>
<VSIXSubPath>WebView</VSIXSubPath>
</Content>
<Content Include="node_modules\node-pty\*;node_modules\node-pty\lib\**\*;node_modules\node-pty\build\Release\**\*" Exclude="node_modules\node-pty\build\Release\**\*.pdb">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\vscode-jsonrpc\**\*">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\xterm\dist\addons\fit\fit.js">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\xterm\dist\xterm.css">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\xterm\dist\xterm.js">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="node_modules\requirejs\require.js">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
</Target>
<Import Project="..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,9 @@
using System;
namespace Microsoft.VisualStudio.Terminal
{
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
internal class OptionItemAttribute: Attribute
{
}
}

Просмотреть файл

@ -0,0 +1,66 @@
using Microsoft.VisualStudio.Settings;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Shell.Settings;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Microsoft.VisualStudio.Terminal
{
internal abstract class OptionsModel
{
private readonly ShellSettingsManager settingsManager;
public OptionsModel(IVsSettingsManager settingsManager)
{
this.settingsManager = new ShellSettingsManager(settingsManager);
this.LoadData();
}
protected abstract string CollectionName { get; }
public void LoadData()
{
var settingsStore = this.settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);
this.EnsureCollection(settingsStore, forceWrite: false);
foreach (var property in GetOptionProperties())
{
var serializedProp = settingsStore.GetString(this.CollectionName, property.Name);
var value = Newtonsoft.Json.JsonConvert.DeserializeObject(serializedProp, property.PropertyType);
property.SetValue(this, value);
}
}
public void SaveData()
{
var settingsStore = this.settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);
this.EnsureCollection(settingsStore, forceWrite: true);
}
private void EnsureCollection(WritableSettingsStore settingsStore, bool forceWrite)
{
if (!settingsStore.CollectionExists(this.CollectionName))
{
settingsStore.CreateCollection(this.CollectionName);
}
foreach (var property in GetOptionProperties())
{
if (forceWrite || !settingsStore.PropertyExists(this.CollectionName, property.Name))
{
var output = Newtonsoft.Json.JsonConvert.SerializeObject(property.GetValue(this));
settingsStore.SetString(this.CollectionName, property.Name, output);
}
}
}
private IEnumerable<PropertyInfo> GetOptionProperties()
{
return this.GetType()
.GetProperties()
.Where(p => p.IsDefined(typeof(OptionItemAttribute), false))
.Where(p => p.PropertyType.IsSerializable);
}
}
}

Просмотреть файл

@ -0,0 +1,29 @@
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
namespace Microsoft.VisualStudio.Terminal
{
public class TerminalOptionPage : DialogPage
{
private TerminalOptionsModel model;
public TerminalOptionPage()
{
ThreadHelper.ThrowIfNotOnUIThread();
IVsSettingsManager settingsManager = (IVsSettingsManager)ServiceProvider.GlobalProvider.GetService(typeof(SVsSettingsManager));
this.model = new TerminalOptionsModel(settingsManager);
}
public override object AutomationObject => this.model;
public override void LoadSettingsFromStorage()
{
this.model.LoadData();
}
public override void SaveSettingsToStorage()
{
this.model.SaveData();
}
}
}

Просмотреть файл

@ -0,0 +1,46 @@
using Microsoft.VisualStudio.Shell.Interop;
using System.ComponentModel;
namespace Microsoft.VisualStudio.Terminal
{
internal class TerminalOptionsModel : OptionsModel
{
public TerminalOptionsModel(IVsSettingsManager settingsManager): base(settingsManager)
{
}
protected override string CollectionName => "WhackWhackTerminalSettings";
[Category("Whack Whack Terminal")]
[DisplayName("Default Shell")]
[OptionItem]
public DefaultTerminal OptionTerminal { get; set; } = DefaultTerminal.Powershell;
[Category("Whack Whack Terminal")]
[DisplayName("Font Family")]
[OptionItem]
public string FontFamily { get; set; } = "Consolas";
[Category("Whack Whack Terminal")]
[DisplayName("Font Size")]
[OptionItem]
public int FontSize { get; set; } = 12;
[Category("Whack Whack Terminal")]
[DisplayName("Startup Argument")]
[OptionItem]
public string StartupArgument { get; set; } = string.Empty;
[Category("Whack Whack Terminal")]
[DisplayName("Change Working Directory on Solution Load")]
[OptionItem]
public bool ChangeDirectory { get; set; } = true;
}
public enum DefaultTerminal
{
Powershell,
CMD,
WSLBash
}
}

Просмотреть файл

@ -16,64 +16,67 @@ function ServicePty(stream, _host) {
this.connection = rpc.createMessageConnection(new rpc.StreamMessageReader(stream), new rpc.StreamMessageWriter(stream));
this.ptyConnection = null;
this.connection.onRequest('initTerm', (shell, cols, rows, start, argument) => this.initTerm(shell, cols, rows, start, argument));
this.connection.onRequest('initTerm', (shell, cols, rows, start, args, env) => this.initTerm(shell, cols, rows, start, args, env));
this.connection.onRequest('termData', (data) => this.termData(data));
this.connection.onRequest('resizeTerm', (cols, rows) => this.resizeTerm(cols, rows));
this.connection.onRequest('closeTerm', () => this.closeTerm());
this.connection.listen();
}
ServicePty.prototype.initTerm = function (shell, cols, rows, startDir, argument) {
var startupArg = ' ' + argument;
ServicePty.prototype.initTerm = function (shell, cols, rows, startDir, args, env) {
if (this.ptyConnection !== null) {
return;
}
var mergedEnvironment = Object.assign(process.env, env);
var shelltospawn;
switch (shell) {
case 'Powershell':
var shelltospawn = powerShellPath;
shelltospawn = powerShellPath;
break;
case 'CMD':
var shelltospawn = cmdPath;
shelltospawn = cmdPath;
break;
case 'WSLBash':
var shelltospawn = bashPath;
shelltospawn = bashPath;
break;
default:
var shelltospawn = powerShellPath;
shelltospawn = shell;
}
if (this.ptyConnection != null) {
// We dont want the exit listeners firing, otherwise we could get an infinite reinit loop
this.ptyConnection.removeAllListeners('exit');
this.ptyConnection.destroy();
}
this.ptyConnection = pty.spawn(shelltospawn, startupArg, {
this.ptyConnection = pty.spawn(shelltospawn, args, {
name: 'vs-integrated-terminal',
cols: cols,
rows: rows,
cwd: startDir,
env: process.env
env: mergedEnvironment
});
this.ptyConnection.on('data', (data) => this.ptyData(data));
this.ptyConnection.on('exit', (code) => this.ptyExit(code));
this.ptyConnection.on('data', (data) => this.connection.sendRequest('PtyData', [data]));
this.ptyConnection.on('exit', (code) => {
this.connection.sendRequest('PtyExit', [code]);
this.closeTerm();
});
}
ServicePty.prototype.termData = function (data) {
if (this.ptyConnection != null) {
if (this.ptyConnection !== null) {
this.ptyConnection.write(data);
}
}
ServicePty.prototype.resizeTerm = function (cols, rows) {
if (this.ptyConnection != null) {
if (this.ptyConnection !== null) {
this.ptyConnection.resize(cols, rows);
}
}
ServicePty.prototype.ptyData = function (data) {
this.connection.sendRequest('PtyData', [data]);
}
ServicePty.prototype.ptyExit = function (code) {
this.connection.sendRequest('ReInitTerm', [code]);
ServicePty.prototype.closeTerm = function () {
if (this.ptyConnection !== null) {
this.ptyConnection.destroy();
this.ptyConnection.removeAllListeners('exit');
this.ptyConnection = null;
}
}
exports.ServicePty = ServicePty;

Просмотреть файл

@ -0,0 +1,34 @@
namespace Microsoft.VisualStudio.Terminal
{
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
/// <summary>
/// This class implements the tool window exposed by this package and hosts a user control.
/// </summary>
/// <remarks>
/// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane,
/// usually implemented by the package implementer.
/// <para>
/// This class derives from the ToolWindowPane class provided from the MPF in order to use its
/// implementation of the IVsUIElementPane interface.
/// </para>
/// </remarks>
[Guid(ServiceToolWindowGuid)]
public class ServiceToolWindow : ToolWindowPane
{
public const string ServiceToolWindowGuid = "ebfb63ec-6efd-4fb3-834f-e9da3a40f2a1";
/// <summary>
/// Initializes a new instance of the <see cref="ServiceToolWindow"/> class.
/// </summary>
public ServiceToolWindow(ToolWindowContext context) : base(null)
{
// This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
// we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
// the object returned by the Content property.
this.Content = new ServiceToolWindowControl(context);
}
}
}

Просмотреть файл

@ -0,0 +1,15 @@
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Microsoft.VisualStudio.Terminal"
xmlns:platformui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
x:Class="Microsoft.VisualStudio.Terminal.ServiceToolWindowControl"
Background="{DynamicResource VsBrush.Window}"
Foreground="{DynamicResource VsBrush.WindowText}"
x:Name="MyToolWindow">
<Grid x:Name="mainGrid">
<local:BetterBrowser x:Name="terminalView" />
</Grid>
</UserControl>

Просмотреть файл

@ -0,0 +1,78 @@
namespace Microsoft.VisualStudio.Terminal
{
using Microsoft.VisualStudio.PlatformUI;
using StreamJsonRpc;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
/// <summary>
/// Interaction logic for ServiceToolWindowControl.
/// </summary>
public partial class ServiceToolWindowControl : UserControl, IDisposable
{
private readonly SolutionUtils solutionUtils;
private readonly TermWindowPackage package;
private readonly JsonRpc rpc;
/// <summary>
/// Initializes a new instance of the <see cref="ServiceToolWindowControl"/> class.
/// </summary>
public ServiceToolWindowControl(ToolWindowContext context)
{
this.InitializeComponent();
this.Focusable = true;
this.GotFocus += TermWindowControl_GotFocus;
var target = new TerminalEvent(context.Package, this.terminalView, context.SolutionUtils);
this.rpc = JsonRpc.Attach(context.ServiceHubStream, target);
this.package = context.Package;
this.solutionUtils = context.SolutionUtils;
}
internal void FinishInitialize(string workingDirectory, string shellPath, IEnumerable<string> args, IDictionary<string, string> env)
{
VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged;
this.terminalView.ScriptingObject = new TerminalScriptingObject(this.package, this.rpc, this.solutionUtils, workingDirectory, false, shellPath, args, env);
string extensionDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string rootPath = Path.Combine(extensionDirectory, "WebView\\default.html").Replace("\\\\", "\\");
this.terminalView.Navigate(new Uri(rootPath));
}
public async Task ChangeWorkingDirectoryAsync(string workingDirectory)
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
this.terminalView.Invoke("triggerEvent", "directoryChanged", workingDirectory);
}
public void Dispose()
{
var helper = (ITerminalScriptingObject)this.terminalView.ScriptingObject;
helper.ClosePty();
}
private void TermWindowControl_GotFocus(object sender, RoutedEventArgs e)
{
// We call focus here because if we don't, the next call will prevent the toolbar from turning blue.
// No functionality is lost when this happens but it is not consistent with VS design conventions.
this.Focus();
this.terminalView.Invoke("triggerEvent", "focus");
}
private void VSColorTheme_ThemeChanged(ThemeChangedEventArgs e)
{
this.package.JoinableTaskFactory.RunAsync(async () =>
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
this.terminalView.Invoke("triggerEvent", "themeChanged", TerminalThemer.GetTheme());
});
}
}
}

Просмотреть файл

@ -0,0 +1,126 @@
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Workspace.VSIntegration;
using System;
using System.Collections.Generic;
using Task = System.Threading.Tasks.Task;
namespace Microsoft.VisualStudio.Terminal
{
internal class SolutionUtils
{
private readonly IVsSolution solutionService;
private readonly IVsWorkspaceFactory workspaceService;
public SolutionUtils(IVsSolution solutionService, IVsWorkspaceFactory workspaceService)
{
ThreadHelper.ThrowIfNotOnUIThread();
this.solutionService = solutionService;
this.workspaceService = workspaceService;
var events = new SolutionEvents(solutionService, this);
this.solutionService.AdviseSolutionEvents(events, out var cookie);
events.Cookie = cookie;
this.workspaceService.OnActiveWorkspaceChanged += WorkspaceChangedAsync;
}
public string GetSolutionDir()
{
ThreadHelper.ThrowIfNotOnUIThread();
this.solutionService.GetSolutionInfo(out var solutionDir, out _, out _);
// solution may sometimes be null in an open folder scenario.
if (solutionDir == null)
{
return this.workspaceService.CurrentWorkspace?.Location;
}
return solutionDir;
}
public event EventHandler<string> SolutionChanged;
private Task WorkspaceChangedAsync(object sender, EventArgs args)
{
var workspaceFactory = sender as IVsWorkspaceFactory;
if (workspaceFactory?.CurrentWorkspace?.Location != null)
{
this.SolutionChanged?.Invoke(this, workspaceFactory?.CurrentWorkspace.Location);
}
return Task.CompletedTask;
}
private class SolutionEvents : IVsSolutionEvents
{
private readonly IVsSolution solutionService;
private readonly SolutionUtils solutionUtils;
public SolutionEvents(IVsSolution solutionService, SolutionUtils solutionUtils)
{
this.solutionService = solutionService;
this.solutionUtils = solutionUtils;
}
public uint? Cookie
{
get;
set;
}
public int OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded)
{
return Microsoft.VisualStudio.VSConstants.S_OK;
}
public int OnQueryCloseProject(IVsHierarchy pHierarchy, int fRemoving, ref int pfCancel)
{
return Microsoft.VisualStudio.VSConstants.S_OK;
}
public int OnBeforeCloseProject(IVsHierarchy pHierarchy, int fRemoved)
{
return Microsoft.VisualStudio.VSConstants.S_OK;
}
public int OnAfterLoadProject(IVsHierarchy pStubHierarchy, IVsHierarchy pRealHierarchy)
{
return Microsoft.VisualStudio.VSConstants.S_OK;
}
public int OnQueryUnloadProject(IVsHierarchy pRealHierarchy, ref int pfCancel)
{
return Microsoft.VisualStudio.VSConstants.S_OK;
}
public int OnBeforeUnloadProject(IVsHierarchy pRealHierarchy, IVsHierarchy pStubHierarchy)
{
return Microsoft.VisualStudio.VSConstants.S_OK;
}
public int OnAfterOpenSolution(object pUnkReserved, int fNewSolution)
{
ThreadHelper.ThrowIfNotOnUIThread();
this.solutionService.GetSolutionInfo(out var solutionDir, out _, out _);
this.solutionUtils.SolutionChanged?.Invoke(this.solutionUtils, solutionDir);
return Microsoft.VisualStudio.VSConstants.S_OK;
}
public int OnQueryCloseSolution(object pUnkReserved, ref int pfCancel)
{
return Microsoft.VisualStudio.VSConstants.S_OK;
}
public int OnBeforeCloseSolution(object pUnkReserved)
{
return Microsoft.VisualStudio.VSConstants.S_OK;
}
public int OnAfterCloseSolution(object pUnkReserved)
{
return Microsoft.VisualStudio.VSConstants.S_OK;
}
}
}
}

Просмотреть файл

@ -1,4 +1,4 @@
namespace EmbeddedTerminal
namespace Microsoft.VisualStudio.Terminal
{
using System;
using System.Runtime.InteropServices;
@ -15,19 +15,21 @@
/// implementation of the IVsUIElementPane interface.
/// </para>
/// </remarks>
[Guid("f7090fd8-8163-4e9a-9616-45ff87e0816e")]
[Guid(TermWindowGuidString)]
public class TermWindow : ToolWindowPane
{
public const string TermWindowGuidString = "f7090fd8-8163-4e9a-9616-45ff87e0816e";
/// <summary>
/// Initializes a new instance of the <see cref="TermWindow"/> class.
/// </summary>
public TermWindow() : base(null)
public TermWindow(ToolWindowContext context) : base()
{
this.Caption = "Terminal Window";
// This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
// we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
// the object returned by the Content property.
this.Content = new TermWindowControl();
this.Content = new TermWindowControl(context);
}
}
}

Просмотреть файл

@ -0,0 +1,56 @@
using System;
using System.ComponentModel.Design;
using Microsoft.VisualStudio.Shell;
using Task = System.Threading.Tasks.Task;
namespace Microsoft.VisualStudio.Terminal
{
/// <summary>
/// Command handler
/// </summary>
internal static class TermWindowCommand
{
/// <summary>
/// Command ID.
/// </summary>
public const int CommandId = 0x0100;
/// <summary>
/// Command menu group (command set GUID).
/// </summary>
public static readonly Guid CommandSet = new Guid("99c4f0ff-b5ca-40de-98a2-e0c4f2725977");
/// <summary>
/// Initializes the singleton instance of the command.
/// </summary>
/// <param name="package">Owner package, not null.</param>
public static async Task InitializeCommandAsync(AsyncPackage package)
{
var commandService = (IMenuCommandService)await package.GetServiceAsync(typeof(IMenuCommandService));
var menuCommandID = new CommandID(CommandSet, CommandId);
var menuItem = new MenuCommand((sender, e) => ShowToolWindow(package, sender, e), menuCommandID);
commandService.AddCommand(menuItem);
}
/// <summary>
/// Shows the tool window when the menu item is clicked.
/// </summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event args.</param>
private static void ShowToolWindow(AsyncPackage package, object sender, EventArgs e)
{
// Get the instance number 0 of this tool window. This window is single instance so this instance
// is actually the only one.
// The last flag is set to true so that if the tool window does not exists it will be created.
package.JoinableTaskFactory.RunAsync(async () =>
{
ToolWindowPane window = await package.ShowToolWindowAsync(
typeof(TermWindow),
0,
create: true,
cancellationToken: package.DisposalToken);
}).FileAndForget("WhackWhackTerminal/TerminalWindow/Open");
}
}
}

Просмотреть файл

@ -0,0 +1,15 @@
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Microsoft.VisualStudio.Terminal"
xmlns:platformui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
x:Class="Microsoft.VisualStudio.Terminal.TermWindowControl"
Background="{DynamicResource VsBrush.Window}"
Foreground="{DynamicResource VsBrush.WindowText}"
x:Name="MyToolWindow">
<Grid x:Name="mainGrid">
<local:BetterBrowser x:Name="terminalView" />
</Grid>
</UserControl>

Просмотреть файл

@ -0,0 +1,78 @@
namespace Microsoft.VisualStudio.Terminal
{
using Microsoft.VisualStudio.Shell;
using System.IO;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System;
using StreamJsonRpc;
using Microsoft.VisualStudio.PlatformUI;
/// <summary>
/// Interaction logic for TermWindowControl.
/// </summary>
public partial class TermWindowControl : UserControl, IDisposable
{
private readonly TermWindowPackage package;
/// <summary>
/// Initializes a new instance of the <see cref="TermWindowControl"/> class.
/// </summary>
public TermWindowControl(ToolWindowContext context)
{
this.InitializeComponent();
this.package = context.Package;
this.Focusable = true;
this.GotFocus += TermWindowControl_GotFocus;
var target = new TerminalEvent(context.Package, this.terminalView, context.SolutionUtils);
var rpc = JsonRpc.Attach(context.ServiceHubStream, target);
context.SolutionUtils.SolutionChanged += SolutionUtils_SolutionChanged;
VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged;
this.terminalView.ScriptingObject = new TerminalScriptingObject(context.Package, rpc, context.SolutionUtils, null, true, null, null, null);
string extensionDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string rootPath = Path.Combine(extensionDirectory, "WebView\\default.html").Replace("\\\\", "\\");
this.terminalView.Navigate(new Uri(rootPath));
}
public void Dispose()
{
var helper = (ITerminalScriptingObject)this.terminalView.ScriptingObject;
helper.ClosePty();
}
private void TermWindowControl_GotFocus(object sender, RoutedEventArgs e)
{
// We call focus here because if we don't, the next call will prevent the toolbar from turning blue.
// No functionality is lost when this happens but it is not consistent with VS design conventions.
this.Focus();
this.terminalView.Invoke("triggerEvent", "focus");
}
private void VSColorTheme_ThemeChanged(ThemeChangedEventArgs e)
{
this.package.JoinableTaskFactory.RunAsync(async () =>
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
this.terminalView.Invoke("triggerEvent", "themeChanged", TerminalThemer.GetTheme());
});
}
private void SolutionUtils_SolutionChanged(object sender, string solutionDir)
{
if (this.package.OptionChangeDirectory)
{
this.package.JoinableTaskFactory.RunAsync(async () =>
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
this.terminalView.Invoke("triggerEvent", "directoryChanged", solutionDir);
});
}
}
}
}

Просмотреть файл

@ -0,0 +1,155 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.Terminal.VsService;
using Microsoft.ServiceHub.Client;
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Workspace.VSIntegration.Contracts;
using Task = System.Threading.Tasks.Task;
namespace Microsoft.VisualStudio.Terminal
{
/// <summary>
/// This is the class that implements the package exposed by this assembly.
/// </summary>
/// <remarks>
/// <para>
/// The minimum requirement for a class to be considered a valid package for Visual Studio
/// is to implement the IVsPackage interface and register itself with the shell.
/// This package uses the helper classes defined inside the Managed Package Framework (MPF)
/// to do it: it derives from the Package class that provides the implementation of the
/// IVsPackage interface and uses the registration attributes defined in the framework to
/// register itself and its components with the shell. These attributes tell the pkgdef creation
/// utility what data to put into .pkgdef file.
/// </para>
/// <para>
/// To get loaded into VS, the package must be referred by &lt;Asset Type="Microsoft.VisualStudio.VsPackage" ...&gt; in .vsixmanifest file.
/// </para>
/// </remarks>
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About
[Guid(TermWindowPackage.PackageGuidString)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
[ProvideMenuResource("Menus.ctmenu", 1)]
[ProvideToolWindow(typeof(TermWindow), Style = VsDockStyle.Tabbed, Window = "34E76E81-EE4A-11D0-AE2E-00A0C90FFFC3")]
[ProvideToolWindow(typeof(ServiceToolWindow), Transient = true, MultiInstances = true, Style = VsDockStyle.Tabbed, Window = TermWindow.TermWindowGuidString)]
[ProvideOptionPage(typeof(TerminalOptionPage), "Whack Whack Terminal", "General", 0, 0, true)]
[ProvideService(typeof(STerminalService), IsAsyncQueryable = true)]
public sealed class TermWindowPackage : AsyncPackage
{
/// <summary>
/// TermWindowPackage GUID string.
/// </summary>
public const string PackageGuidString = "35b633bd-cdfb-4eda-8c26-f557e419eb8a";
private IVsSettingsManager settingsManager;
/// <summary>
/// Initialization of the package; this method is called right after the package is sited, so this is the place
/// where you can put all the initialization code that rely on services provided by VisualStudio.
/// </summary>
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
{
await base.InitializeAsync(cancellationToken, progress);
this.AddService(typeof(STerminalService), CreateServiceAsync, promote: true);
await this.JoinableTaskFactory.SwitchToMainThreadAsync();
this.settingsManager = (IVsSettingsManager)await this.GetServiceAsync(typeof(SVsSettingsManager));
await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
await TermWindowCommand.InitializeCommandAsync(this);
}
private Task<object> CreateServiceAsync(IAsyncServiceContainer container, CancellationToken cancellationToken, Type serviceType)
{
return Task.FromResult((object)new EmbeddedTerminalService(this));
}
public override IVsAsyncToolWindowFactory GetAsyncToolWindowFactory(Guid toolWindowType)
{
if (toolWindowType.Equals(new Guid(TermWindow.TermWindowGuidString)) || toolWindowType.Equals(new Guid(ServiceToolWindow.ServiceToolWindowGuid)))
{
return this;
}
return null;
}
protected override string GetToolWindowTitle(Type toolWindowType, int id)
{
if (toolWindowType == typeof(TermWindow) || toolWindowType == typeof(ServiceToolWindow))
{
return "Terminal Window";
}
return base.GetToolWindowTitle(toolWindowType, id);
}
protected override async Task<object> InitializeToolWindowAsync(Type toolWindowType, int id, CancellationToken cancellationToken)
{
await this.JoinableTaskFactory.SwitchToMainThreadAsync();
var solutionService = (IVsSolution)await this.GetServiceAsync(typeof(SVsSolution));
var componentModel = (IComponentModel)await this.GetServiceAsync(typeof(SComponentModel));
var workspaceService = componentModel.GetService<IVsFolderWorkspaceService>();
var solutionUtils = new SolutionUtils(solutionService, workspaceService);
var client = new HubClient();
var clientStream = await client.RequestServiceAsync("wwt.pty");
return new ToolWindowContext()
{
Package = this,
ServiceHubStream = clientStream,
SolutionUtils = solutionUtils,
};
}
public DefaultTerminal OptionTerminal
{
get
{
TerminalOptionsModel optionsModel = new TerminalOptionsModel(this.settingsManager);
return optionsModel.OptionTerminal;
}
}
public string OptionStartupArgument
{
get
{
TerminalOptionsModel optionsModel = new TerminalOptionsModel(this.settingsManager);
return optionsModel.StartupArgument;
}
}
public bool OptionChangeDirectory
{
get
{
TerminalOptionsModel optionsModel = new TerminalOptionsModel(this.settingsManager);
return optionsModel.ChangeDirectory;
}
}
public string OptionFontFamily
{
get
{
TerminalOptionsModel optionsModel = new TerminalOptionsModel(this.settingsManager);
return optionsModel.FontFamily;
}
}
public int OptionFontSize
{
get
{
TerminalOptionsModel optionsModel = new TerminalOptionsModel(this.settingsManager);
return optionsModel.FontSize;
}
}
}
}

Просмотреть файл

@ -0,0 +1,25 @@
using System.IO;
namespace Microsoft.VisualStudio.Terminal
{
public class ToolWindowContext
{
internal TermWindowPackage Package
{
set;
get;
}
internal SolutionUtils SolutionUtils
{
set;
get;
}
internal Stream ServiceHubStream
{
set;
get;
}
}
}

Просмотреть файл

@ -0,0 +1,102 @@
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using System;
using Task = System.Threading.Tasks.Task;
namespace Microsoft.VisualStudio.Terminal.VsService
{
public class EmbeddedTerminal : ITerminal
{
private readonly TermWindowPackage package;
private readonly ServiceToolWindow windowPane;
public event EventHandler Closed;
public EmbeddedTerminal(TermWindowPackage package, ServiceToolWindow windowPane)
{
ThreadHelper.ThrowIfNotOnUIThread();
this.package = package;
this.windowPane = windowPane;
if (this.windowPane.Frame is IVsWindowFrame2 windowFrame)
{
var events = new WindowFrameEvents(windowFrame, this);
windowFrame.Advise(events, out var cookie);
events.Cookie = cookie;
}
}
public async Task CloseAsync()
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
(this.windowPane.Frame as IVsWindowFrame)?.CloseFrame((uint)__FRAMECLOSE.FRAMECLOSE_NoSave);
}
public async Task HideAsync()
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
(this.windowPane.Frame as IVsWindowFrame)?.Hide();
}
public async Task ShowAsync()
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync();
(this.windowPane.Frame as IVsWindowFrame)?.Show();
}
public Task ChangeWorkingDirectoryAsync(string newDirectory)
{
return ((ServiceToolWindowControl)this.windowPane.Content).ChangeWorkingDirectoryAsync(newDirectory);
}
private class WindowFrameEvents: IVsWindowFrameNotify, IVsWindowFrameNotify2
{
private readonly IVsWindowFrame2 frame;
private EmbeddedTerminal terminal;
public WindowFrameEvents(IVsWindowFrame2 frame, EmbeddedTerminal terminal)
{
this.frame = frame;
this.terminal = terminal;
}
public uint? Cookie
{
get;
set;
}
public int OnClose(ref uint pgrfSaveOptions)
{
ThreadHelper.ThrowIfNotOnUIThread();
terminal.Closed?.Invoke(terminal, EventArgs.Empty);
if (this.Cookie.HasValue)
{
this.frame?.Unadvise(this.Cookie.Value);
}
return VSConstants.S_OK;
}
public int OnShow(int fShow)
{
return VSConstants.S_OK;
}
public int OnMove()
{
return VSConstants.S_OK;
}
public int OnSize()
{
return VSConstants.S_OK;
}
public int OnDockableChange(int fDockable)
{
return VSConstants.S_OK;
}
}
}
}

Просмотреть файл

@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.VisualStudio.Shell;
namespace Microsoft.VisualStudio.Terminal.VsService
{
public class EmbeddedTerminalService : STerminalService, ITerminalService
{
private int nextToolWindowId = 1;
private readonly TermWindowPackage package;
public EmbeddedTerminalService(TermWindowPackage package)
{
this.package = package;
}
public async Task<object> CreateTerminalAsync(string name, string shellPath, string workingDirectory, IEnumerable<string> args, IDictionary<string, string> environment)
{
await this.package.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);
var pane = (ServiceToolWindow)await package.FindToolWindowAsync(
typeof(ServiceToolWindow),
nextToolWindowId++,
create: true,
cancellationToken: package.DisposalToken);
pane.Caption = name;
((ServiceToolWindowControl)pane.Content).FinishInitialize(workingDirectory, shellPath, args, environment);
return new EmbeddedTerminal(this.package, pane);
}
}
}

Просмотреть файл

@ -0,0 +1,31 @@
<!-- saved from url=(0016)http://localhost -->
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="utf-8" />
<title>Terminal Window</title>
<link rel="stylesheet" href="../node_modules/xterm/dist/xterm.css" />
<link rel="stylesheet" href="default.css" data-plugin-theme="true" />
<script src="../node_modules/requirejs/require.js"></script>
<script>
function triggerEvent(event, data) { }
requirejs.config({
paths: {
'xterm': '../node_modules/xterm/dist/xterm',
'xterm/lib/addons/fit': '../node_modules/xterm/dist/addons/fit/fit'
}
});
require(['main']);
</script>
</head>
<body>
<div id="content" style="height: 100%">
</div>
<div id="debug">
debug:
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,116 @@
import { ITheme, Terminal } from 'xterm';
import { fit } from 'xterm/lib/addons/fit';
import { VisualStudio } from './VsEventManager';
import { registerLocalLinkHandler } from './TerminalLinkMatcher';
// This import and declaraion are necessary due to a strange issue with the way the xterm.js dist file is bundled.
// The definition file would make it seem that the xterm import contains the Terminal object, but at runtime it
// actually is the terminal object.
import * as xterm from 'xterm';
const TerminalConstructor = xterm as any as (typeof Terminal);
export class TermView {
private term: Terminal;
private resizeTimeout: number | null;
private solutionDirectory: string;
constructor(theme: ITheme, fontFamily: string, fontSize: number, solutionDirectory: string) {
this.solutionDirectory = solutionDirectory;
this.term = new TerminalConstructor({
theme: theme,
fontFamily: fontFamily + ', courier-new, courier, monospace',
fontSize: fontSize,
cursorBlink: true,
cols: 80,
rows: 24
});
this.term.open(document.getElementById('content'));
fit(this.term);
this.term.on('data', (data) => this.termData(data));
VisualStudio.Events.on('ptyData', (data) => this.ptyData(data));
VisualStudio.Events.on('themeChanged', (data) => {
let theme = JSON.parse(data) as ITheme;
this.setTheme(theme)
});
VisualStudio.Events.on('directoryChanged', (data) => {
this.solutionDirectory = data;
this.term.write('\x1b[H\x1b[2J');
this.term.writeln('solution changed, restarting terminal in new directory');
this.closePty();
this.initPty(data)
});
VisualStudio.Events.on('ptyExited', (data) => {
this.term.write('\x1b[H\x1b[2J');
this.term.writeln('the terminal exited, initializing a new instance of the terminal');
this.initPty(this.solutionDirectory)
});
VisualStudio.Events.on('focus', () => {
this.term.focus();
});
window.addEventListener("resize", () => this.resizeHandler())
this.registerKeyboardHandlers();
this.initPty(solutionDirectory);
registerLocalLinkHandler(this.term);
}
private initPty(cwd: string) {
window.external.InitPty(this.term.cols, this.term.rows, cwd);
}
private closePty() {
window.external.ClosePty();
}
private termData(data: string) {
window.external.TermData(data);
}
private ptyData(data: string) {
this.term.write(data);
}
private setTheme(theme: ITheme) {
this.term.setOption('theme', theme);
}
private resizeHandler() {
let actualHandler = () => {
fit(this.term);
window.external.ResizePty(this.term.cols, this.term.rows);
};
let timeoutCallback = () => {
this.resizeTimeout = null;
actualHandler();
}
if (!this.resizeTimeout) {
this.resizeTimeout = setTimeout(() => timeoutCallback(), 66);
}
}
private registerKeyboardHandlers() {
this.term.attachCustomKeyEventHandler((event) => {
// capture Ctrl+C
if (event.ctrlKey && event.keyCode === 67 && this.term.hasSelection()) {
window.external.CopyStringToClipboard(this.term.getSelection());
this.term.clearSelection();
return false;
// capture Ctrl+V
} else if (event.ctrlKey && event.keyCode === 86) {
return false;
}
});
window.addEventListener('contextmenu', (event) => {
if (this.term.hasSelection()) {
window.external.CopyStringToClipboard(this.term.getSelection());
this.term.clearSelection();
} else {
let content = window.external.GetClipboard();
this.termData(content);
}
});
}
}

Просмотреть файл

@ -0,0 +1,28 @@
import { Terminal } from 'xterm';
import { TermView } from './TermView';
const LOCAL_LINK_PRIORITY = -2;
function handleLocalLink(event: MouseEvent, uri: string) {
// We call the handle function on a small timeout to cause it to happen after the click event has fully
// propogated. This ensures that focus properly transfers to the editor.
setTimeout(() => window.external.HandleLocalLink(uri), 1);
event.preventDefault();
}
function validateLocalLink(uri: string, callback: { (isValid: boolean): void }) {
if (window.external.ValidateLocalLink(uri)) {
callback(true);
} else {
callback(false);
}
}
export function registerLocalLinkHandler(terminal: Terminal) {
let regex = new RegExp(window.external.GetLinkRegex());
terminal.registerLinkMatcher(regex, handleLocalLink, {
validationCallback: validateLocalLink,
priority: LOCAL_LINK_PRIORITY
});
}

Просмотреть файл

@ -0,0 +1,33 @@
export namespace VisualStudio {
const eventStrings = {
themeChanged: '',
ptyData: '',
ptyExited: '',
directoryChanged: '',
focus: ''
};
export type EventType = keyof typeof eventStrings;
export function isEventType(event: string): event is EventType {
return eventStrings.hasOwnProperty(event);
}
export class Events {
static handlers: { [event: string]: { (data: any): void }[] } = {};
static on(event: EventType, handler: { (data: any): void }) {
if (Events.handlers[event as string] === undefined) {
Events.handlers[event as string] = new Array();
}
Events.handlers[event as string].push(handler);
}
static off(event: EventType, handler: { (data: any): void }) {
Events.handlers[event as string] = Events.handlers[event as string].filter(h => h !== handler);
}
static triggerEvent(event: EventType, data: any) {
Events.handlers[event as string].forEach(handler => handler(data));
}
}
}

17
Microsoft.VisualStudio.Terminal/WebView/ts/external.d.ts поставляемый Normal file
Просмотреть файл

@ -0,0 +1,17 @@
interface External {
GetTheme(): string;
GetFontFamily(): string;
GetFontSize(): number;
GetSolutionDir(): string;
InitPty(cols: number, rows: number, dir: string): void;
ClosePty(): void;
CopyStringToClipboard(stringToCopy: string): void;
GetClipboard(): string;
TermData(data: string): void;
ResizePty(cols: number, rows: number): void;
GetLinkRegex(): string;
HandleLocalLink(uri: string): void;
ValidateLocalLink(link: string): boolean;
}
declare var triggerEvent: {(event: string, data: any): void };

Просмотреть файл

@ -0,0 +1,24 @@
import { TermView } from './TermView';
import { VisualStudio } from './VsEventManager';
triggerEvent = function (event: string, data: any) {
if (VisualStudio.isEventType(event)) {
VisualStudio.Events.triggerEvent(event, data);
}
};
if (document.readyState !== 'loading') {
let termView = new TermView(
JSON.parse(window.external.GetTheme()),
window.external.GetFontFamily(),
window.external.GetFontSize(),
window.external.GetSolutionDir());
} else {
document.addEventListener("DOMContentLoaded", function (event) {
let termView = new TermView(
JSON.parse(window.external.GetTheme()),
window.external.GetFontFamily(),
window.external.GetFontSize(),
window.external.GetSolutionDir());
});
}

Просмотреть файл

@ -4,7 +4,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="StreamJsonRpc" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="1.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.ServiceHub.Client" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@ -12,7 +12,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Validation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@ -20,7 +20,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-15.6.0.0" newVersion="15.6.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

38
Microsoft.VisualStudio.Terminal/package-lock.json сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,38 @@
{
"name": "embeddedterminal",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"node-pty": {
"version": "0.7.4",
"resolved": "https://registry.npmjs.org/node-pty/-/node-pty-0.7.4.tgz",
"integrity": "sha512-WxMY1BsGcHJ2Z2qWpYL7QbfOSnkkCzV0H/9+dJ7uQEIJyz0A4fVBLymswBCTc7RoweY5ingib2gNvf87KvJxuA==",
"requires": {
"nan": "2.8.0"
},
"dependencies": {
"nan": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz",
"integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo="
}
}
},
"requirejs": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.5.tgz",
"integrity": "sha1-YXuay7yzNlQO9JFNeQMjqNS4YbA="
},
"vscode-jsonrpc": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz",
"integrity": "sha1-hyOdnhZrLXNSJFuKgTWXgEwdY6o="
},
"xterm": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/xterm/-/xterm-3.1.0.tgz",
"integrity": "sha1-f34cjPS4C9iBpOiJEhO4UUI+kMk="
}
}
}

Просмотреть файл

@ -4,8 +4,9 @@
"description": "embedded terminal ui in VS",
"author": "Daniel Griffen",
"dependencies": {
"node-pty": "^0.6.10",
"vscode-jsonrpc": "^3.3.1",
"xterm": "=2.8.1"
"node-pty": "^0.7.2",
"requirejs": "^2.3.5",
"vscode-jsonrpc": "^3.5.0",
"xterm": "=3.1.0"
}
}

Просмотреть файл

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.ServiceHub.Client" version="1.0.226-rc" targetFramework="net46" />
<package id="Microsoft.TypeScript.MSBuild" version="2.7.1" targetFramework="net46" developmentDependency="true" />
<package id="Microsoft.VisualStudio.CoreUtility" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.ImageCatalog" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Imaging" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" version="14.3.25407" targetFramework="net46" />
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6071" targetFramework="net46" />
<package id="Microsoft.VisualStudio.SDK.EmbedInteropTypes" version="15.0.16" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.15.0" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Framework" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop" version="7.10.6072" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.10.0" version="10.0.30320" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.11.0" version="11.0.61031" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.12.0" version="12.0.30110" targetFramework="net461" />
<package id="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime" version="14.3.25407" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime" version="15.0.26929" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.8.0" version="8.0.50728" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.9.0" version="9.0.30730" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Text.Data" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.TextManager.Interop" version="7.10.6071" targetFramework="net46" />
<package id="Microsoft.VisualStudio.TextManager.Interop.8.0" version="8.0.50728" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Threading" version="15.6.31" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Threading.Analyzers" version="15.6.31" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Utilities" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Validation" version="15.3.15" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Workspace" version="15.0.401" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Workspace.VSIntegration" version="15.0.401" targetFramework="net46" />
<package id="Microsoft.VSSDK.BuildTools" version="15.5.100" targetFramework="net46" developmentDependency="true" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
<package id="StreamJsonRpc" version="1.3.23" targetFramework="net46" />
</packages>

Просмотреть файл

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="WhackWhackTerminal.6f6b45b8-e50b-4d45-87f0-c304abf8ff0f" Version="0.2.8" Language="en-US" Publisher="Daniel Griffen" />
<Identity Id="WhackWhackTerminal.6f6b45b8-e50b-4d45-87f0-c304abf8ff0f" Version="0.3.0" Language="en-US" Publisher="Daniel Griffen" />
<DisplayName>Whack Whack Terminal</DisplayName>
<Description xml:space="preserve">Terminal emulator for Visual Studio. Allows you to run command prompt, powershell, WSL bash. All including interactive mode.</Description>
<MoreInfo>https://marketplace.visualstudio.com/items?itemName=DanielGriffen.WhackWhackTerminal</MoreInfo>
<ReleaseNotes>ReleaseNotes.txt</ReleaseNotes>
<ReleaseNotes>https://github.com/Microsoft/WhackWhackTerminal/blob/master/CHANGELOG.md</ReleaseNotes>
<Icon>BrandWhackWhackTerminal_256x.png</Icon>
<Tags>terminal,git,bash,cmd,command prompt,powershell,shell</Tags>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0]" />
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0.27319, 16.0)" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
@ -21,7 +21,7 @@
</Prerequisites>
<Assets>
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.ServiceHub.Service" d:Source="File" Path="service\wwt.pty.servicehub.service.json" />
<Asset Type="Microsoft.ServiceHub.Service" d:Source="File" Path="ServiceHub\wwt.pty.servicehub.service.json" />
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
</Assets>
</PackageManifest>

Просмотреть файл

@ -4,7 +4,7 @@
## Prerequisites
You need the following components installed in order to build WhackWhackTerminal
- Visual Studio 2017 with extensibility workload
- Node.js v6.11.2 LTS (**32-bit**)
- Node.js v8.9.4 LTS (**32-bit**)
- Python 2.7
- Visual C++ Build Tools 2015

Просмотреть файл

@ -3,15 +3,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26913.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmbeddedTerminal", "EmbeddedTerminal\EmbeddedTerminal.csproj", "{ED2D97CC-2A98-48D4-AE1F-2277CB987C04}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.Terminal", "Microsoft.VisualStudio.Terminal\Microsoft.VisualStudio.Terminal.csproj", "{ED2D97CC-2A98-48D4-AE1F-2277CB987C04}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{032FDE40-347B-4441-A50B-1BF2D4A0CEB2}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
CHANGELOG.md = CHANGELOG.md
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.Terminal.Embeddable", "Microsoft.VisualStudio.Terminal.Embeddable\Microsoft.VisualStudio.Terminal.Embeddable.csproj", "{4BEFDAB9-7266-43D6-8089-7723865AA483}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TerminalServiceTests", "TerminalServiceTests\TerminalServiceTests.csproj", "{08A1792C-3A20-4BE9-87CF-C9B8FC32F047}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -22,6 +27,14 @@ Global
{ED2D97CC-2A98-48D4-AE1F-2277CB987C04}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED2D97CC-2A98-48D4-AE1F-2277CB987C04}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED2D97CC-2A98-48D4-AE1F-2277CB987C04}.Release|Any CPU.Build.0 = Release|Any CPU
{4BEFDAB9-7266-43D6-8089-7723865AA483}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4BEFDAB9-7266-43D6-8089-7723865AA483}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4BEFDAB9-7266-43D6-8089-7723865AA483}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4BEFDAB9-7266-43D6-8089-7723865AA483}.Release|Any CPU.Build.0 = Release|Any CPU
{08A1792C-3A20-4BE9-87CF-C9B8FC32F047}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08A1792C-3A20-4BE9-87CF-C9B8FC32F047}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08A1792C-3A20-4BE9-87CF-C9B8FC32F047}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08A1792C-3A20-4BE9-87CF-C9B8FC32F047}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Двоичные данные
TerminalServiceTests/Key.snk Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TerminalServiceTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TerminalServiceTests")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Двоичные данные
TerminalServiceTests/Resources/TerminalFunctionsCommand.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичные данные
TerminalServiceTests/Resources/TerminalFunctionsPackage.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 418 KiB

Просмотреть файл

@ -0,0 +1,35 @@
namespace TerminalServiceTests
{
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Terminal;
/// <summary>
/// This class implements the tool window exposed by this package and hosts a user control.
/// </summary>
/// <remarks>
/// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane,
/// usually implemented by the package implementer.
/// <para>
/// This class derives from the ToolWindowPane class provided from the MPF in order to use its
/// implementation of the IVsUIElementPane interface.
/// </para>
/// </remarks>
[Guid("4d0c7b72-bb72-4fbb-a7ce-5fdc81ed6721")]
public class TerminalFunctions : ToolWindowPane
{
/// <summary>
/// Initializes a new instance of the <see cref="TerminalFunctions"/> class.
/// </summary>
public TerminalFunctions(ToolWindowContext context) : base(null)
{
this.Caption = "TerminalFunctions";
// This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
// we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
// the object returned by the Content property.
this.Content = new TerminalFunctionsControl(context);
}
}
}

Просмотреть файл

@ -0,0 +1,55 @@
using System;
using System.ComponentModel.Design;
using System.Globalization;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Task = System.Threading.Tasks.Task;
namespace TerminalServiceTests
{
/// <summary>
/// Command handler
/// </summary>
internal sealed class TerminalFunctionsCommand
{
/// <summary>
/// Command ID.
/// </summary>
public const int CommandId = 0x0100;
/// <summary>
/// Command menu group (command set GUID).
/// </summary>
public static readonly Guid CommandSet = new Guid("17aa71f3-6754-4047-86c2-83ff7e345402");
/// <summary>
/// Initializes the singleton instance of the command.
/// </summary>
/// <param name="package">Owner package, not null.</param>
public static async Task InitializeCommandAsync(AsyncPackage package)
{
var commandService = (IMenuCommandService)await package.GetServiceAsync(typeof(IMenuCommandService));
var menuCommandID = new CommandID(CommandSet, CommandId);
var menuItem = new MenuCommand((sender, e) => ShowToolWindow(package, sender, e), menuCommandID);
commandService.AddCommand(menuItem);
}
/// <summary>
/// Shows the tool window when the menu item is clicked.
/// </summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event args.</param>
private static void ShowToolWindow(AsyncPackage package, object sender, EventArgs e)
{
package.JoinableTaskFactory.RunAsync(async () =>
{
await package.ShowToolWindowAsync(
typeof(TerminalFunctions),
0,
create: true,
cancellationToken: package.DisposalToken);
}).FileAndForget("WhackWhackTerminal/TerminalFunctionsWindow/Open");
}
}
}

Просмотреть файл

@ -0,0 +1,22 @@
<UserControl x:Class="TerminalServiceTests.TerminalFunctionsControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"
Background="{DynamicResource {x:Static vsshell:VsBrushes.WindowKey}}"
Foreground="{DynamicResource {x:Static vsshell:VsBrushes.WindowTextKey}}"
mc:Ignorable="d"
Name="MyToolWindow">
<Grid>
<StackPanel Orientation="Vertical">
<TextBlock Margin="10" HorizontalAlignment="Center">TerminalFunctions</TextBlock>
<Button Content="Create" Click="Create_Click" Width="120" Height="80" Name="Create"/>
<Button Content="Show" Click="Show_Click" Width="120" Height="80" Name="Show"/>
<Button Content="Hide" Click="Hide_Click" Width="120" Height="80" Name="Hide"/>
<Button Content="Close" Click="Close_Click" Width="120" Height="80" Name="Close"/>
<TextBox Name="DirectoryPath" Margin="0, 30, 0, 0"></TextBox>
<Button Content="Change Directory" Click="Change_Click" Width="120" Height="80" Name="Change"></Button>
</StackPanel>
</Grid>
</UserControl>

Просмотреть файл

@ -0,0 +1,99 @@
namespace TerminalServiceTests
{
using Microsoft.VisualStudio.Terminal;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
/// <summary>
/// Interaction logic for TerminalFunctionsControl.
/// </summary>
public partial class TerminalFunctionsControl : UserControl
{
private readonly ITerminalService terminalService;
private readonly TerminalFunctionsPackage package;
private readonly IDictionary<string, string> env;
private ITerminal terminal;
/// <summary>
/// Initializes a new instance of the <see cref="TerminalFunctionsControl"/> class.
/// </summary>
public TerminalFunctionsControl(ToolWindowContext context)
{
this.InitializeComponent();
this.terminalService = context.TerminalService;
this.package = context.Package;
this.env = new Dictionary<string, string>()
{
{ "FOO_VAR", "BAR_VAL" },
{ "BAZ_VAR", "BIF_VAL" },
};
}
/// <summary>
/// Handles click on the button by displaying a message box.
/// </summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event args.</param>
private void Create_Click(object sender, RoutedEventArgs e)
{
this.package.JoinableTaskFactory.RunAsync(async () =>
{
this.terminal = (ITerminal)await this.terminalService.CreateTerminalAsync("test name", null, "C:\\", new List<string>() { "-NoExit", "-Command", "pwd" }, null);
this.terminal.Closed += Terminal_Closed;
});
}
private void Terminal_Closed(object sender, System.EventArgs e)
{
MessageBox.Show("Terminal has closed");
}
private void Show_Click(object sender, RoutedEventArgs e)
{
this.package.JoinableTaskFactory.RunAsync(async () =>
{
if (this.terminal != null)
{
await this.terminal.ShowAsync();
}
});
}
private void Hide_Click(object sender, RoutedEventArgs e)
{
this.package.JoinableTaskFactory.RunAsync(async () =>
{
if (this.terminal != null)
{
await this.terminal.HideAsync();
}
});
}
private void Close_Click(object sender, RoutedEventArgs e)
{
this.package.JoinableTaskFactory.RunAsync(async () =>
{
if (this.terminal != null)
{
await this.terminal.CloseAsync();
}
});
}
private void Change_Click(object sender, RoutedEventArgs e)
{
this.package.JoinableTaskFactory.RunAsync(async () =>
{
if (this.terminal != null)
{
await this.terminal?.ChangeWorkingDirectoryAsync(this.DirectoryPath.Text);
}
});
}
}
}

Просмотреть файл

@ -4,13 +4,17 @@ using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Terminal;
using Microsoft.Win32;
using Task = System.Threading.Tasks.Task;
namespace EmbeddedTerminal
namespace TerminalServiceTests
{
/// <summary>
/// This is the class that implements the package exposed by this assembly.
@ -29,66 +33,61 @@ namespace EmbeddedTerminal
/// To get loaded into VS, the package must be referred by &lt;Asset Type="Microsoft.VisualStudio.VsPackage" ...&gt; in .vsixmanifest file.
/// </para>
/// </remarks>
[PackageRegistration(UseManagedResourcesOnly = true)]
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About
[ProvideMenuResource("Menus.ctmenu", 1)]
[ProvideToolWindow(typeof(TermWindow))]
[Guid(TermWindowPackage.PackageGuidString)]
[ProvideToolWindow(typeof(TerminalFunctions))]
[Guid(TerminalFunctionsPackage.PackageGuidString)]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
[ProvideOptionPage(typeof(TerminalOptionPage), "Whack Whack Terminal", "General", 0, 0, true)]
public sealed class TermWindowPackage : Package
public sealed class TerminalFunctionsPackage : AsyncPackage
{
/// <summary>
/// TermWindowPackage GUID string.
/// TerminalFunctionsPackage GUID string.
/// </summary>
public const string PackageGuidString = "35b633bd-cdfb-4eda-8c26-f557e419eb8a";
public const string PackageGuidString = "0e17f474-fc17-4662-8824-cb7fa6550d06";
#region Package Members
/// <summary>
/// Initializes a new instance of the <see cref="TerminalFunctions"/> class.
/// </summary>
public TerminalFunctionsPackage()
{
// Inside this method you can place any initialization code that does not require
// any Visual Studio service because at this point the package object is created but
// not sited yet inside Visual Studio environment. The place to do all the other
// initialization is the Initialize method.
}
/// <summary>
/// Initialization of the package; this method is called right after the package is sited, so this is the place
/// where you can put all the initialization code that rely on services provided by VisualStudio.
/// </summary>
protected override void Initialize()
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
{
TermWindowPackage.Instance = this;
TermWindowCommand.Initialize(this);
base.Initialize();
await base.InitializeAsync(cancellationToken, progress);
await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
await TerminalFunctionsCommand.InitializeCommandAsync(this);
}
public static TermWindowPackage Instance
public override IVsAsyncToolWindowFactory GetAsyncToolWindowFactory(Guid toolWindowType)
{
get;
private set;
return this;
}
public DefaultTerminal OptionTerminal
protected override string GetToolWindowTitle(Type toolWindowType, int id)
{
get
return "Terminal Functions";
}
protected override async Task<object> InitializeToolWindowAsync(Type toolWindowType, int id, CancellationToken cancellationToken)
{
var terminalService = (ITerminalService)await this.GetServiceAsync(typeof(STerminalService));
return new ToolWindowContext()
{
TerminalOptionPage page = (TerminalOptionPage)GetDialogPage(typeof(TerminalOptionPage));
return page.OptionTerminal;
}
Package = this,
TerminalService = terminalService
};
}
public string OptionCustomCSSPath
{
get
{
TerminalOptionPage page = (TerminalOptionPage)GetDialogPage(typeof(TerminalOptionPage));
return page.CustomCSSPath;
}
}
public string OptionStartupArgument
{
get
{
TerminalOptionPage page = (TerminalOptionPage)GetDialogPage(typeof(TerminalOptionPage));
return page.StartupArgument;
}
}
#endregion
}
}

Просмотреть файл

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This is the file that defines the actual layout and type of the commands.
It is divided in different sections (e.g. command definition, command
placement, ...), with each defining a specific set of properties.
See the comment before each section for more details about how to
use it. -->
<!-- The VSCT compiler (the tool that translates this file into the binary
format that VisualStudio will consume) has the ability to run a preprocessor
on the vsct file; this preprocessor is (usually) the C++ preprocessor, so
it is possible to define includes and macros with the same syntax used
in C++ files. Using this ability of the compiler here, we include some files
defining some of the constants that we will use inside the file. -->
<!--This is the file that defines the IDs for all the commands exposed by VisualStudio. -->
<Extern href="stdidcmd.h"/>
<!--This header contains the command ids for the menus provided by the shell. -->
<Extern href="vsshlids.h"/>
<!--The Commands section is where commands, menus, and menu groups are defined.
This section uses a Guid to identify the package that provides the command defined inside it. -->
<Commands package="guidTerminalFunctionsPackage">
<!-- Inside this section we have different sub-sections: one for the menus, another
for the menu groups, one for the buttons (the actual commands), one for the combos
and the last one for the bitmaps used. Each element is identified by a command id that
is a unique pair of guid and numeric identifier; the guid part of the identifier is usually
called "command set" and is used to group different command inside a logically related
group; your package should define its own command set in order to avoid collisions
with command ids defined by other packages. -->
<!--Buttons section. -->
<!--This section defines the elements the user can interact with, like a menu command or a button
or combo box in a toolbar. -->
<Buttons>
<!--To define a menu group you have to specify its ID, the parent menu and its display priority.
The command is visible and enabled by default. If you need to change the visibility, status, etc, you can use
the CommandFlag node.
You can add more than one CommandFlag node e.g.:
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
If you do not want an image next to your command, remove the Icon node /> -->
<Button guid="guidTerminalFunctionsPackageCmdSet" id="TerminalFunctionsCommandId" priority="0x0100" type="Button">
<Parent guid="guidSHLMainMenu" id="IDG_VS_WNDO_OTRWNDWS1"/>
<Icon guid="guidImages" id="bmpPic1" />
<Strings>
<ButtonText>TerminalFunctions</ButtonText>
</Strings>
</Button>
</Buttons>
<!--The bitmaps section is used to define the bitmaps that are used for the commands.-->
<Bitmaps>
<!-- The bitmap id is defined in a way that is a little bit different from the others:
the declaration starts with a guid for the bitmap strip, then there is the resource id of the
bitmap strip containing the bitmaps and then there are the numeric ids of the elements used
inside a button definition. An important aspect of this declaration is that the element id
must be the actual index (1-based) of the bitmap inside the bitmap strip. -->
<Bitmap guid="guidImages" href="Resources\TerminalFunctionsCommand.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows, bmpPicStrikethrough"/>
</Bitmaps>
</Commands>
<Symbols>
<!-- This is the package guid. -->
<GuidSymbol name="guidTerminalFunctionsPackage" value="{0e17f474-fc17-4662-8824-cb7fa6550d06}" />
<!-- This is the guid used to group the menu commands together -->
<GuidSymbol name="guidTerminalFunctionsPackageCmdSet" value="{17aa71f3-6754-4047-86c2-83ff7e345402}">
<IDSymbol name="TerminalFunctionsCommandId" value="0x0100" />
</GuidSymbol>
<GuidSymbol name="guidImages" value="{fc1fede7-5370-4bf2-8ec1-e3b039642e55}" >
<IDSymbol name="bmpPic1" value="1" />
<IDSymbol name="bmpPic2" value="2" />
<IDSymbol name="bmpPicSearch" value="3" />
<IDSymbol name="bmpPicX" value="4" />
<IDSymbol name="bmpPicArrows" value="5" />
<IDSymbol name="bmpPicStrikethrough" value="6" />
</GuidSymbol>
</Symbols>
</CommandTable>

Просмотреть файл

@ -0,0 +1,261 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<UseCodebase>true</UseCodebase>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{08A1792C-3A20-4BE9-87CF-C9B8FC32F047}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TerminalServiceTests</RootNamespace>
<AssemblyName>TerminalServiceTests</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<StartAction>Program</StartAction>
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootsuffix Exp</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TerminalFunctions.cs" />
<Compile Include="TerminalFunctionsCommand.cs" />
<Compile Include="TerminalFunctionsControl.xaml.cs">
<DependentUpon>TerminalFunctionsControl.xaml</DependentUpon>
</Compile>
<Compile Include="TerminalFunctionsPackage.cs" />
<Compile Include="ToolWindowContext.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Key.snk" />
<None Include="packages.config" />
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="TerminalFunctionsControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.CommandBars, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.CoreUtility.15.6.27413\lib\net45\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.ImageCatalog, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.ImageCatalog.15.6.27413\lib\net45\Microsoft.VisualStudio.ImageCatalog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Imaging, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Imaging.15.6.27413\lib\net45\Microsoft.VisualStudio.Imaging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.14.3.25407\lib\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6071\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.15.0.15.6.27413\lib\net45\Microsoft.VisualStudio.Shell.15.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Embeddable, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Embeddable.15.5.27130\lib\net45\Microsoft.VisualStudio.Shell.Embeddable.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Framework.15.6.27413\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6072\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30320\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61031\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30110\lib\Microsoft.VisualStudio.Shell.Interop.12.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.14.3.25407\lib\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.15.0.26929\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.15.6.27413\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30730\lib\net11\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Text.Data.15.6.27413\lib\net45\Microsoft.VisualStudio.Text.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6071\lib\net11\Microsoft.VisualStudio.TextManager.Interop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Threading, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Threading.15.6.31\lib\net46\Microsoft.VisualStudio.Threading.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Utilities.15.6.27413\lib\net46\Microsoft.VisualStudio.Utilities.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Validation.15.3.15\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="StreamJsonRpc, Version=1.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\StreamJsonRpc.1.3.23\lib\net45\StreamJsonRpc.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Content Include="Resources\TerminalFunctionsCommand.png" />
<Content Include="Resources\TerminalFunctionsPackage.ico" />
<VSCTCompile Include="TerminalFunctionsPackage.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
</VSCTCompile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="VSPackage.resx">
<MergeWithCTO>true</MergeWithCTO>
<ManifestResourceName>VSPackage</ManifestResourceName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.VisualStudio.Terminal.Embeddable\Microsoft.VisualStudio.Terminal.Embeddable.csproj">
<Project>{4befdab9-7266-43d6-8089-7723865aa483}</Project>
<Name>Microsoft.VisualStudio.Terminal.Embeddable</Name>
<EmbedInteropTypes>true</EmbedInteropTypes>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.6.31\analyzers\cs\Microsoft.VisualStudio.Threading.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" />
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.5.100\build\Microsoft.VSSDK.BuildTools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
using Microsoft.VisualStudio.Terminal;
namespace TerminalServiceTests
{
public class ToolWindowContext
{
public TerminalFunctionsPackage Package
{
get;
set;
}
public ITerminalService TerminalService
{
get;
set;
}
}
}

Просмотреть файл

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
VS SDK Notes: This resx file contains the resources that will be consumed from your package by Visual Studio.
For example, Visual Studio will attempt to load resource '400' from this resource stream when it needs to
load your package's icon. Because Visual Studio will always look in the VSPackage.resources stream first for
resources it needs, you should put additional resources that Visual Studio will load directly into this resx
file.
Resources that you would like to access directly from your package in a strong-typed fashion should be stored
in Resources.resx or another resx file.
-->
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="110" xml:space="preserve">
<value>TerminalFunctions Extension</value>
</data>
<data name="112" xml:space="preserve">
<value>TerminalFunctions Visual Studio Extension Detailed Info</value>
</data>
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\TerminalFunctionsPackage.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Просмотреть файл

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.6.0.0" newVersion="15.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Validation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="StreamJsonRpc" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.0.0" newVersion="1.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VisualStudio.CoreUtility" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.ImageCatalog" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Imaging" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" version="14.3.25407" targetFramework="net46" />
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6071" targetFramework="net46" />
<package id="Microsoft.VisualStudio.SDK.EmbedInteropTypes" version="15.0.16" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.15.0" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Embeddable" version="15.5.27130" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Framework" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop" version="7.10.6072" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.10.0" version="10.0.30320" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.11.0" version="11.0.61031" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.12.0" version="12.0.30110" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime" version="14.3.25407" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime" version="15.0.26929" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.8.0" version="8.0.50728" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Shell.Interop.9.0" version="9.0.30730" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Text.Data" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.TextManager.Interop" version="7.10.6071" targetFramework="net46" />
<package id="Microsoft.VisualStudio.TextManager.Interop.8.0" version="8.0.50728" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Threading" version="15.6.31" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Threading.Analyzers" version="15.6.31" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Utilities" version="15.6.27413" targetFramework="net46" />
<package id="Microsoft.VisualStudio.Validation" version="15.3.15" targetFramework="net46" />
<package id="Microsoft.VSSDK.BuildTools" version="15.5.100" targetFramework="net46" developmentDependency="true" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
<package id="StreamJsonRpc" version="1.3.23" targetFramework="net46" />
</packages>

Просмотреть файл

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="TerminalServiceTests.9f9b3768-a99e-4eb7-a675-5bd9eb16df05" Version="1.0" Language="en-US" Publisher="Daniel Griffen" />
<DisplayName>TerminalServiceTests</DisplayName>
<Description>Empty VSIX Project.</Description>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0]" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
<Dependency Id="Microsoft.VisualStudio.MPF.15.0" DisplayName="Visual Studio MPF 15.0" d:Source="Installed" Version="[15.0]" />
</Dependencies>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
</Prerequisites>
<Assets>
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
</Assets>
</PackageManifest>

Просмотреть файл

@ -1,11 +1,22 @@
image: Visual Studio 2017
install:
- ps: Install-Product node 6 x86
- ps: Install-Product node 8 x86
- ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex
before_build:
- ps: Vsix-IncrementVsixVersion -manifestFilePath '.\Microsoft.VisualStudio.Terminal\source.extension.vsixmanifest' -versionType revision | Vsix-UpdateBuildVersion
- ps: Vsix-TokenReplacement .\Microsoft.VisualStudio.Terminal.Embeddable\Microsoft.VisualStudio.Terminal.Embeddable.csproj '0.0.0.0' '{version}'
build_script:
- nuget restore -Verbosity quiet
- cd EmbeddedTerminal
- cd Microsoft.VisualStudio.Terminal
- npm install
- cd ..
- msbuild .\EmbeddedTerminal\EmbeddedTerminal.csproj /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
- msbuild .\TermWindow.sln /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m /t:build
artifacts:
- path: '.\Microsoft.VisualStudio.Terminal\**\*.vsix'
name: WhackWhackTerminal
- path: '.\Microsoft.VisualStudio.Terminal.Embeddable\**\*.nupkg'
name: NuGet Package