Compare commits

..

8 Commits

Author SHA1 Message Date
Mike Griese
f75166e87a chef kiss 2026-03-04 13:03:12 -06:00
Mike Griese
9e0ff8835f save when the workspace closes 2026-03-04 12:27:33 -06:00
Mike Griese
fd5ddfb4c0 some menu touch up 2026-03-04 08:29:11 -06:00
Mike Griese
d2fcfdc6b3 oh my fucking god 2026-03-03 16:51:34 -06:00
Mike Griese
34b3029fb1 tests 2026-03-03 12:48:50 -06:00
Mike Griese
45ddf94067 is that really everything? 2026-03-03 11:04:15 -06:00
Mike Griese
abb06e1918 todos 2026-03-03 06:10:34 -06:00
Mike Griese
eb2899e267 yea i guess 2026-03-02 14:23:16 -06:00
273 changed files with 4734 additions and 5805 deletions

View File

@@ -67,7 +67,6 @@ servicebus
slnt
stakeholders
subpage
subpages
sustainability
sxn
Tencent

View File

@@ -572,7 +572,6 @@ FGHIJ
fgidx
FGs
FILEDESCRIPTION
filehops
FILESUBTYPE
FILESYSPATH
FILEW
@@ -1135,7 +1134,6 @@ NOSIZE
NOSNAPSHOT
NOTHOUSANDS
NOTICKS
notif
NOTIMEOUTIFNOTHUNG
NOTIMPL
NOTOPMOST
@@ -1774,7 +1772,6 @@ uldash
uldb
ULONGLONG
ulwave
Unaccess
Unadvise
unattend
UNCPRIORITY
@@ -1797,7 +1794,6 @@ UPKEY
upss
uregex
URegular
urxvt
usebackq
USECALLBACK
USECOLOR
@@ -1884,7 +1880,6 @@ WCIA
WCIW
wcs
WCSHELPER
wcsicmp
wcsrev
wcswidth
wddm

View File

@@ -93,7 +93,7 @@ jobs:
steps:
- name: check-spelling
id: spelling
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
uses: check-spelling/check-spelling@v0.0.25
with:
suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }}
checkout: true
@@ -153,7 +153,7 @@ jobs:
if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
steps:
- name: comment
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
uses: check-spelling/check-spelling@v0.0.25
with:
checkout: true
spell_check_this: microsoft/terminal@main
@@ -171,7 +171,7 @@ jobs:
if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request')
steps:
- name: comment
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
uses: check-spelling/check-spelling@v0.0.25
with:
checkout: true
spell_check_this: microsoft/terminal@main
@@ -197,7 +197,7 @@ jobs:
cancel-in-progress: false
steps:
- name: apply spelling updates
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
uses: check-spelling/check-spelling@v0.0.25
with:
experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }}
checkout: true

View File

@@ -15,6 +15,7 @@
- [Via Chocolatey (unofficial)](#via-chocolatey-unofficial)
- [Via Scoop (unofficial)](#via-scoop-unofficial)
- [Installing Windows Terminal Canary](#installing-windows-terminal-canary)
- [Windows Terminal Roadmap](#windows-terminal-roadmap)
- [Terminal \& Console Overview](#terminal--console-overview)
- [Windows Terminal](#windows-terminal)
- [The Windows Console Host](#the-windows-console-host)
@@ -177,6 +178,11 @@ _Learn more about the [types of Windows Terminal distributions](https://learn.mi
---
## Windows Terminal Roadmap
The plan for the Windows Terminal [is described here](/doc/roadmap-2023.md) and
will be updated as the project proceeds.
## Terminal & Console Overview
Please take a few minutes to review the overview below before diving into the

View File

@@ -56,10 +56,9 @@ Dies ist ein Open Source-Projekt, und wir freuen uns über die Teilnahme der Com
<ReleaseNotes>
Version __VERSION_NUMBER__
Endlich die Möglichkeit, nach beliebigen Einstellungen zu suchen!
Ein neuer nativer Editor für Tastenkombinationen, Aktionen und Einträge in der Befehlspalette.
Neue Community-Übersetzungen für Serbisch und Ukrainisch
Unterstützung für das „Kitty“-Tastaturprotokoll für hochauflösende Eingabecodierung
Eine komplett neue Erweiterungsseite, die anzeigt, was in Ihrem Terminal installiert ist
Die Befehlspalette wird jetzt sowohl in Ihrer Muttersprache als auch auf Englisch angezeigt
Neue VT-Features wie synchronisiertes Rendering, neue Farbschemas, Konfiguration für schnelle Mausaktionen wie Zoomen und mehr
Weitere Informationen finden Sie auf unserer GitHub-Releaseseite.
</ReleaseNotes>

View File

@@ -54,12 +54,11 @@ This is an open source project and we welcome community participation. To partic
<!-- _locComment_text="{MaxLength=255} App DevStudio" -->
</DevStudio>
<ReleaseNotes _locID="App_ReleaseNotes">
<!-- _locComment_text="{MaxLength=1500} {Locked=__VERSION_NUMBER__}{Locked=wt.exe}{Locked=Kitty} App Release Note" -->Version __VERSION_NUMBER__
<!-- _locComment_text="{MaxLength=1500} {Locked=__VERSION_NUMBER__}{Locked=wt.exe} App Release Note" -->Version __VERSION_NUMBER__
- Finally, the ability to search for any setting!
- A new native editor for key bindings, actions and command palette entries.
- New community localizations to Serbian and Ukrainian
- Support for the "Kitty" keyboard protocol for high-fidelity input encoding
- A whole new Extensions page that shows what has been installed into your Terminal
- Command Palette now shows up in your native language as well as English
- New VT features such as synchronized rendering, new color schemes, configuration for quick mouse actions like zooming, and more
Please see our GitHub releases page for additional details.
</ReleaseNotes>

View File

@@ -54,12 +54,11 @@ Este es un proyecto de fuente abierta y animamos a la comunidad a participar. Pa
</DevStudio>
<ReleaseNotes>
Version __VERSION_NUMBER__
Versión __VERSION_NUMBER__
- Por último, la capacidad de buscar cualquier configuración.
- Nuevo editor nativo para asignaciones de teclas, acciones y entradas de la paleta de comandos.
- Nuevas localizaciones comunitarias para serbio y ucraniano
- Soporte para el protocolo de teclado "Kitty" para codificación de entrada de alta fidelidad
- Página Extensiones completamente nueva que muestra lo que se ha instalado en tu terminal
- La paleta de comandos ahora se muestra en tu idioma nativo, así como en inglés
- Nuevas características de VT, como la representación sincronizada, nuevos esquemas de color, configuración para acciones rápidas del ratón, como el zoom, y más
Consulta la página de versiones de GitHub para más información.
</ReleaseNotes>

View File

@@ -56,12 +56,11 @@ Il sagit dun projet open source et nous vous invitons à participer dans l
<ReleaseNotes>
Version __VERSION_NUMBER__
- Enfin, la possibilité de rechercher nimporte quel paramètre !
- Un nouvel éditeur natif pour les raccourcis clavier, les actions et les entrées de la palette de commandes.
- De nouvelles localisations communautaires en serbe et en ukrainien
- Une prise en charge du protocole clavier « Kitty » pour un encodage dentrée à haute fidélité
- Une toute nouvelle page Extensions qui montre ce qui a été installé dans votre terminal
- La palette de commandes saffiche désormais dans votre langue native, ainsi quen anglais
- Nouvelles fonctionnalités VT telles que le rendu synchronisé, de nouveaux schémas de couleurs, la configuration pour des actions rapides de la souris comme le zoom, et plus encore
Consultez notre page des versions de GitHub pour plus de détails.
Veuillez consulter notre page des versions GitHub pour découvrir dautres détails.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -54,12 +54,11 @@ Si tratta di un progetto open source e la partecipazione della community è molt
</DevStudio>
<ReleaseNotes>
Versione __VERSION_NUMBER__
Versione __VERSION_NUMBER__
- Finalmente è possibile cercare qualsiasi impostazione
- Nuovo editor nativo per le associazioni di tasti, le azioni e le voci del riquadro comandi.
- Nuove localizzazioni della community in serbo e ucraino
- Supporto per il protocollo di tastiera "Kitty" per una codifica dell'input ad alta fedeltà
- Una pagina Estensioni completamente nuova che mostra ciò che è stato installato nel terminale
- Il riquadro comandi ora viene visualizzato nella tua lingua di origine oltre che in inglese
- Nuove funzionalità VT come il rendering sincronizzato, le nuove combinazioni di colori, la configurazione per azioni rapide del mouse come lo zoom e altro ancora
Per altri dettagli, vedi la pagina delle release di GitHub.
</ReleaseNotes>

View File

@@ -56,10 +56,9 @@
<ReleaseNotes>
バージョン __VERSION_NUMBER__
- 最後に、任意の設定を検索する機能です。
- キー バインド、アクション、コマンド パレット エントリ用の新しいネイティブ エディター。
- セルビア語とウクライナ語への新しいコミュニティ ローカライズ
- 高忠実度入力エンコード用の "Kitty" キーボード プロトコルのサポート
- ターミナルに何がインストールされているかを表示する新しい [拡張機能] ページ
- コマンド パレットがネイティブ言語と英語で表示されるようになりました
- 同期レンダリング、新しい配色、ズームなどのクイック マウス操作の構成などの、新しい VT 機能
詳細については、GitHub リリース ページをご覧ください。
</ReleaseNotes>

View File

@@ -56,12 +56,11 @@
<ReleaseNotes>
버전 __VERSION_NUMBER__
- 드디어 모든 설정을 검색할 수 있게 되었어요!
- 키 바인딩, 작업, 명령 팔레트 항목을 위한 새로운 기본 편집기가 추가되었습니다.
- 세르비아어와 우크라이나어 커뮤니티 지역화를 새롭게 지원합니다.
- 고품질 입력 인코딩을 위해 "Kitty" 키보드 프로토콜을 지원합니다.
- 터미널에 설치된 항목을 보여 주는 완전히 새로운 확장 페이지
- 명령 팔레트가 이제 영어뿐만 아니라 모국어로도 표시
- 동기화된 렌더링, 새로운 색 구성표, 확대/축소와 같은 빠른 마우스 동작을 위한 구성 등 새로운 VT 기능이 추가
자세한 정보는 GitHub 릴리스 페이지를 참하세요.
자세한 내용은 GitHub 릴리스 페이지를 참하세요.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,10 +56,9 @@ Este é um projeto de código aberto e a participação da comunidade é bem-vin
<ReleaseNotes>
Version __VERSION_NUMBER__
- Finalmente, a possibilidade de pesquisar qualquer configuração!
- Um novo editor nativo para combinações de teclas, ações e entradas na paleta de comandos.
- Novas localizações da comunidade para sérvio e ucraniano
- Suporte para o protocolo de teclado "Kitty" para codificação de entrada de alta fidelidade
Uma nova página de Extensões que mostra o que foi instalado no seu Terminal
A Paleta de Comandos agora aparece no seu idioma nativo, além do inglês
Novos recursos da VT, como renderização sincronizada, novos esquemas de cores, configuração para ações rápidas do mouse, como zoom, e muito mais
Confira nossa página de lançamentos no GitHub para obter mais detalhes.
</ReleaseNotes>

View File

@@ -56,12 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- ₣ïňάĺĺў, ŧне âъΐŀίťŷ ţø şēаґсђ ƒбг ăиÿ şēťτіήġ! !!! !!! !!! !!! !!!
- Á ŋеώ ñăŧїνе ěðíτōг ƒοѓ ќэÿ вїñďĭňğş, дčтιθήѕ дñð çθmmãήδ ρàľěţťę ёñтгĩέś. !!! !!! !!! !!! !!! !!! !!! !
- Пėώ čоmmμñìтў ŀό¢àłįżåţίòйš ŧō Šэґъιäñ åηδ Ůκŗăįлīăπ !!! !!! !!! !!! !!! !
- Ѕυррòŗт ƒòŗ ťĥё "Kitty" ĸ℮ŷъøàŗď ρřŏťô¢õℓ ƒŏґ нįģћ-ƒíđёℓïтÿ îńрüť êńсøďíлğ !!! !!! !!! !!! !!! !!! !!! !
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
Ρŀ℮âѕē şєё όûя ĜîтΗūь ŕεĺĕǻŝёš раġĕ ƒŏґ ãδđϊŧïбπåľ δеτáΐłś. !!! !!! !!! !!! !!! !!!
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,12 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- ₣ïňάĺĺў, ŧне âъΐŀίťŷ ţø şēаґсђ ƒбг ăиÿ şēťτіήġ! !!! !!! !!! !!! !!!
- Á ŋеώ ñăŧїνе ěðíτōг ƒοѓ ќэÿ вїñďĭňğş, дčтιθήѕ дñð çθmmãήδ ρàľěţťę ёñтгĩέś. !!! !!! !!! !!! !!! !!! !!! !
- Пėώ čоmmμñìтў ŀό¢àłįżåţίòйš ŧō Šэґъιäñ åηδ Ůκŗăįлīăπ !!! !!! !!! !!! !!! !
- Ѕυррòŗт ƒòŗ ťĥё "Kitty" ĸ℮ŷъøàŗď ρřŏťô¢õℓ ƒŏґ нįģћ-ƒíđёℓïтÿ îńрüť êńсøďíлğ !!! !!! !!! !!! !!! !!! !!! !
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
Ρŀ℮âѕē şєё όûя ĜîтΗūь ŕεĺĕǻŝёš раġĕ ƒŏґ ãδđϊŧïбπåľ δеτáΐłś. !!! !!! !!! !!! !!! !!!
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,12 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- ₣ïňάĺĺў, ŧне âъΐŀίťŷ ţø şēаґсђ ƒбг ăиÿ şēťτіήġ! !!! !!! !!! !!! !!!
- Á ŋеώ ñăŧїνе ěðíτōг ƒοѓ ќэÿ вїñďĭňğş, дčтιθήѕ дñð çθmmãήδ ρàľěţťę ёñтгĩέś. !!! !!! !!! !!! !!! !!! !!! !
- Пėώ čоmmμñìтў ŀό¢àłįżåţίòйš ŧō Šэґъιäñ åηδ Ůκŗăįлīăπ !!! !!! !!! !!! !!! !
- Ѕυррòŗт ƒòŗ ťĥё "Kitty" ĸ℮ŷъøàŗď ρřŏťô¢õℓ ƒŏґ нįģћ-ƒíđёℓïтÿ îńрüť êńсøďíлğ !!! !!! !!! !!! !!! !!! !!! !
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
Ρŀ℮âѕē şєё όûя ĜîтΗūь ŕεĺĕǻŝёš раġĕ ƒŏґ ãδđϊŧïбπåľ δеτáΐłś. !!! !!! !!! !!! !!! !!!
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,10 +56,9 @@
<ReleaseNotes>
Версия __VERSION_NUMBER__
Наконец-то появилась возможность поиска любых параметров!
Новый собственный редактор для настраиваемых сочетаний клавиш, действий и записей палитры команд.
Новые локализации сообщества на сербский и украинский языки
Поддержка протокола клавиатуры Kitty для высокоточного кодирования ввода
Новая страница расширений, на которой отображается информация о том, что было установлено в вашем терминале
Палитра команд теперь доступна на вашем языке, а также на английском
Новые функции VT, например синхронизированная отрисовка, новые цветовые схемы, настройка быстрых действий мыши, таких как масштабирование, и т. д.
Дополнительные сведения см. на странице выпусков GitHub.
</ReleaseNotes>

View File

@@ -1,182 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ProductDescription language="sr-cyrl-rs" xmlns="http://schemas.microsoft.com/appx/2012/ProductDescription" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" Release="">
<AppStoreName _locID="App_AppStoreName">
<!-- This is optional. AppStoreName is typically extracted from your package's AppxManifest DisplayName property. -->
<!-- Uncomment (and localize) this Store name if your application package does not contain a localization for the DisplayName in this language. -->
<!-- Leaving this uncommented for a language that your application package DOES contain a DisplayName for will result in a submission failure with the API. -->
<!-- _locComment_text="{MaxLength=200} App AppStoreName" -->
<!-- Windows Terminal -->
</AppStoreName>
<Keywords>
<!-- Valid length: 30 character limit, up to 7 elements -->
<Keyword _locID="App_keyword1">
<!-- _locComment_text="{MaxLength=30} App keyword 1" -->Терминал</Keyword>
<Keyword _locID="App_keyword2">
<!-- _locComment_text="{MaxLength=30} App keyword 2" -->Конзола</Keyword>
<Keyword _locID="App_keyword3">
<!-- _locComment_text="{MaxLength=30} App keyword 3" -->
</Keyword>
<Keyword _locID="App_keyword4">
<!-- _locComment_text="{MaxLength=30} App keyword 4" -->
</Keyword>
<Keyword _locID="App_keyword5">
<!-- _locComment_text="{MaxLength=30} App keyword 5" -->
</Keyword>
<Keyword _locID="App_keyword6">
<!-- _locComment_text="{MaxLength=30} App keyword 6" -->
</Keyword>
<Keyword _locID="App_keyword7">
<!-- _locComment_text="{MaxLength=30} App keyword 7" -->
</Keyword>
</Keywords>
<Description _locID="App_Description">
<!-- _locComment_text="{MaxLength=10000} App Description" -->Ово је изградња прегледа апликације Windows терминал. Она садржи најновије могућности које се још увек развијају. Windows терминал је модерна, брза, ефикасна, моћна и продуктивна апликација терминала за кориснике алата из командне линије и љуски као што су Command Prompt, PowerShell, и WSL. Неке од његових главних функционалности су вишеструке картице, панели, подршка за Уникод и UTF-8, GPU убрзани механизам за исцртавање текста, произвољне теме, стилови и конфигурације.
Ово је пројекат отвореног кода и учешће заједнице је добродошло. Ако желите да учествујете, молимо вас да посетите https://github.com/microsoft/terminal </Description>
<ShortDescription _locID="App_ShortDescription">
<!-- Only used for games. This description appears in the Information section of the Game Hub on Xbox One, and helps customers understand more about your game. -->
<!-- _locComment_text="{MaxLength=500} App ShortDescription" -->
</ShortDescription>
<ShortTitle _locID="App_ShortTitle">
<!-- A shorter version of your product's name. If provided, this shorter name may appear in various places on Xbox One (during installation, in Achievements, etc.) in place of the full title of your product. -->
<!-- _locComment_text="{MaxLength=50} App ShortTitle" -->
</ShortTitle>
<SortTitle _locID="App_SortTitle">
<!-- If your product could be alphabetized in different ways, you can enter another version here. This may help customers find the product more quickly when searching. -->
<!-- _locComment_text="{MaxLength=255} App SortTitle" -->
</SortTitle>
<VoiceTitle _locID="App_VoiceTitle">
<!-- An alternate name for your product that, if provided, may be used in the audio experience on Xbox One when using Kinect or a headset. -->
<!-- _locComment_text="{MaxLength=255} App VoiceTitle" -->
</VoiceTitle>
<DevStudio _locID="App_DevStudio">
<!-- Specify this value if you want to include a "Developed by" field in the listing. (The "Published by" field will list the publisher display name associated with your account, whether or not you provide a devStudio value.) -->
<!-- _locComment_text="{MaxLength=255} App DevStudio" -->
</DevStudio>
<ReleaseNotes _locID="App_ReleaseNotes">
<!-- _locComment_text="{MaxLength=1500} {Locked=__VERSION_NUMBER__}{Locked=wt.exe}{Locked=Kitty} App Release Note" -->Верзија __VERSION_NUMBER__
- Коначно, могућност претраге било ког подешавања!
- Нови својствени едитор ставки пречица на тастатури, акција и командне палете
- Нова локализација заједнице на српски и украјински језик
- Подршка за „Kitty” протокол тастатуре који омогућава верно кодирање уноса
За више детаља, молимо вас да посетите нашу GitHub страницу издања.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
<!-- Valid attributes: any of DesktopImage, MobileImage, XboxImage, SurfaceHubImage, and HoloLensImage -->
<Caption DesktopImage="acrylic-emoji.png" _locID="App_caption1">
<!-- _locComment_text="{MaxLength=200} Screenshot caption 1" -->
</Caption>
<Caption DesktopImage="panes.png" _locID="App_caption2">
<!-- _locComment_text="{MaxLength=200} Screenshot caption 2" -->
</Caption>
<Caption DesktopImage="htop.png" _locID="App_caption3">
<!-- _locComment_text="{MaxLength=200} Screenshot caption 3" -->
</Caption>
</ScreenshotCaptions>
<AdditionalAssets>
<!-- Valid elements:-->
<!-- HeroImage414x180, HeroImage846x468, HeroImage558x756, HeroImage414x468, HeroImage558x558, HeroImage2400x1200,-->
<!-- ScreenshotWXGA, ScreenshotHD720, ScreenshotWVGA, Doublewide, Panoramic, Square,-->
<!-- SmallMobileTile, SmallXboxLiveTile, LargeMobileTile, LargeXboxLiveTile, Tile,-->
<!-- DesktopIcon, Icon (use this value for the 1:1 300x300 pixels logo), AchievementIcon,-->
<!-- ChallengePromoIcon, RewardDisplayIcon, Icon150X150, Icon71X71,-->
<!-- BoxArt, BrandedKeyArt, PosterArt, FeaturedPromotionalArt, PromotionalArt16x9, TitledHeroArt-->
<!-- There is no content for any of these elements, just a single attribute called FileName. -->
<PosterArt FileName="Store Poster Art.png" />
<BoxArt FileName="Store Box Art.png" />
<PromotionalArt16x9 FileName="Store Thumbnail.png" />
</AdditionalAssets>
<Trailers>
<!-- Maximum number of trailers permitted: 15 -->
<Trailer FileName="CC0605_CommandLine_Teaser_WEB_MASTER_H264_1080p_23.976_-16LKFS_-3dbTP_ST.mp4">
<Title _locID="App_trailerTitle1">
<!-- _locComment_text="{MaxLength=255} Trailer title 1" -->Нови Windows терминал</Title>
<Images>
<!-- Current maximum of 1 image per trailer permitted. -->
<Image FileName="Store Thumbnail.png">
<!-- _locComment_text="{Locked} Trailer screenshot 1 description" -->
</Image>
</Images>
</Trailer>
</Trailers>
<AppFeatures>
<!-- Valid length: 200 character limit, up to 20 elements -->
<AppFeature _locID="App_feature1">
<!-- _locComment_text="{MaxLength=200} App Feature 1" -->Вишеструке картице</AppFeature>
<AppFeature _locID="App_feature2">
<!-- _locComment_text="{MaxLength=200} App Feature 2" -->Пуна Уникод подршка</AppFeature>
<AppFeature _locID="App_feature3">
<!-- _locComment_text="{MaxLength=200} App Feature 3" -->GPU-убрзано исцртавање текста</AppFeature>
<AppFeature _locID="App_feature4">
<!-- _locComment_text="{MaxLength=200} App Feature 4" -->Потпуна прилагодљивост</AppFeature>
<AppFeature _locID="App_feature5">
<!-- _locComment_text="{MaxLength=200} App Feature 5" -->Подела панела</AppFeature>
<AppFeature _locID="App_feature6">
<!-- _locComment_text="{MaxLength=200} App Feature 6" -->
</AppFeature>
<AppFeature _locID="App_feature7">
<!-- _locComment_text="{MaxLength=200} App Feature 7" -->
</AppFeature>
<AppFeature _locID="App_feature8">
<!-- _locComment_text="{MaxLength=200} App Feature 8" -->
</AppFeature>
<AppFeature _locID="App_feature9">
<!-- _locComment_text="{MaxLength=200} App Feature 9" -->
</AppFeature>
<AppFeature _locID="App_feature10">
<!-- _locComment_text="{MaxLength=200} App Feature 10" -->
</AppFeature>
<AppFeature _locID="App_feature11">
<!-- _locComment_text="{MaxLength=200} App Feature 11" -->
</AppFeature>
<AppFeature _locID="App_feature12">
<!-- _locComment_text="{MaxLength=200} App Feature 12" -->
</AppFeature>
<AppFeature _locID="App_feature13">
<!-- _locComment_text="{MaxLength=200} App Feature 13" -->
</AppFeature>
<AppFeature _locID="App_feature14">
<!-- _locComment_text="{MaxLength=200} App Feature 14" -->
</AppFeature>
<AppFeature _locID="App_feature15">
<!-- _locComment_text="{MaxLength=200} App Feature 15" -->
</AppFeature>
<AppFeature _locID="App_feature16">
<!-- _locComment_text="{MaxLength=200} App Feature 16" -->
</AppFeature>
<AppFeature _locID="App_feature17">
<!-- _locComment_text="{MaxLength=200} App Feature 17" -->
</AppFeature>
<AppFeature _locID="App_feature18">
<!-- _locComment_text="{MaxLength=200} App Feature 18" -->
</AppFeature>
<AppFeature _locID="App_feature19">
<!-- _locComment_text="{MaxLength=200} App Feature 19" -->
</AppFeature>
<AppFeature _locID="App_feature20">
<!-- _locComment_text="{MaxLength=200} App Feature 20" -->
</AppFeature>
</AppFeatures>
<RecommendedHardware>
<!-- Valid length: 200 character limit, up to 11 elements -->
<Recommendation _locID="App_RecommendedHW1">
<!-- _locComment_text="{MaxLength=200} App Recommended Hardware 1" -->Тастатура</Recommendation>
</RecommendedHardware>
<MinimumHardware>
<!-- Valid length: 200 character limit, up to 11 elements -->
</MinimumHardware>
<CopyrightAndTrademark _locID="App_CopyrightandTrademark">
<!-- _locComment_text="{MaxLength=200} Copyright and Trademark" -->Copyright (c) Microsoft Corporation</CopyrightAndTrademark>
<AdditionalLicenseTerms _locID="App_AdditionalLicenseTerms">
<!-- _locComment_text="{MaxLength=10000} Additional License Terms" -->
</AdditionalLicenseTerms>
<WebsiteURL _locID="App_WebsiteURL">
<!-- _locComment_text="{MaxLength=2048} WebsiteURL" -->https://github.com/microsoft/terminal</WebsiteURL>
<SupportContactInfo _locID="App_SupportContactInfo">
<!-- _locComment_text="{MaxLength=2048} Support Contact Info" -->https://github.com/microsoft/terminal/issues/new</SupportContactInfo>
<PrivacyPolicyURL _locID="App_PrivacyURL">
<!-- _locComment_text="{MaxLength=2048} Privacy Policy URL" -->https://go.microsoft.com/fwlink/?LinkID=521839</PrivacyPolicyURL>
</ProductDescription>

View File

@@ -56,10 +56,9 @@
<ReleaseNotes _locID="App_ReleaseNotes">
<!-- _locComment_text="{MaxLength=1500} {Locked=__VERSION_NUMBER__}{Locked=wt.exe} App Release Note" -->Версія __VERSION_NUMBER__
- Нарешті, можливість пошуку будь-якого налаштування!
- Новий вбудований редактор для прив'язки клавіш, дій та палітри команд.
- Нові локалізації спільноти на сербську та українську мови.
- Підтримка протоколу клавіатури "Kitty" для високоточного кодування введення.
- Цілком нова сторінка розширень, яка показує, що було встановлено у вашому терміналі
- Палітра команд тепер відображається вашою рідною мовою, а також англійською
- Нові функції віртуального автомата, такі як синхронізований рендеринг, нові колірні схеми, налаштування для швидких дій миші, таких як масштабування, тощо
Будь ласка, перегляньте нашу сторінку релізів GitHub для отримання додаткової інформації.
</ReleaseNotes>

View File

@@ -56,10 +56,9 @@
<ReleaseNotes>
Version __VERSION_NUMBER__
- 终于可以搜索任何设置了!
- 新增用于键绑定、操作和命令面板条目的原生编辑器。
- 新增塞尔维亚语和乌克兰语社区本地化支持
- 支持 "Kitty" 键盘协议,实现高保真输入编码
- 一个全新的“扩展”页,显示已安装到终端的内容
- 命令面板现在以你的母语和英语显示
- 新的 VT 功能,例如同步渲染、新配色方案、快速鼠标操作(如缩放)的配置等
有关其他详细信息,请参阅我们的 GitHub 发布页面。
</ReleaseNotes>

View File

@@ -56,10 +56,9 @@
<ReleaseNotes>
Version __VERSION_NUMBER__
- 終於,提供可搜尋任何設定的功能!
- 全新原生編輯器,支援按鍵繫結、動作及命令選擇區項目。
- 新增社群本地語系化,包含塞爾維亞語與烏克蘭語
- 支援高保真度輸入編碼的「Kitty」鍵盤通訊協定
- 全新的延伸模組頁面會顯示已安裝在您終端機中的內容
- 命令選擇區現在以您的母語和英文顯示
- 新的 VT 功能,例如同步轉譯、新的色彩配置、快速滑鼠動作 (例如縮放) 設定等等
如需更多詳細資料,請參閱我們的 GitHub 發行版本頁面。
</ReleaseNotes>

View File

@@ -56,9 +56,9 @@ Dies ist ein Open Source-Projekt, und wir freuen uns über die Teilnahme an der
<ReleaseNotes>
Version __VERSION_NUMBER__
Eine komplett neue Erweiterungsseite, die anzeigt, was in Ihrem Terminal installiert ist
Die Befehlspalette wird jetzt sowohl in Ihrer Muttersprache als auch auf Englisch angezeigt
Neue VT-Features wie synchronisiertes Rendering, neue Farbschemas, Konfiguration für schnelle Mausaktionen wie Zoomen und mehr
Wir haben der Benutzeroberfläche Dutzende von Einstellungen hinzugefügt, die nur einmal in der JSON-Datei vorhanden waren, einschließlich einer neuen Seite zum Anpassen des Layouts Ihres Menüs „Neue Registerkarte“!
Wir haben die Fensterverwaltung umgestaltet, um die Zuverlässigkeit zu verbessern. Melden Sie alle Fehler, die beim alias „wt.exe“ auftreten
Profile zeigen jetzt ein Symbol an, wenn sie ausgeblendet wurden oder auf Programme verweisen, die deinstalliert wurden.
Weitere Informationen finden Sie auf unserer GitHub-Releaseseite.
</ReleaseNotes>

View File

@@ -56,9 +56,9 @@ This is an open source project and we welcome community participation. To partic
<ReleaseNotes _locID="App_ReleaseNotes">
<!-- _locComment_text="{MaxLength=1500} {Locked=__VERSION_NUMBER__}{Locked=wt.exe} App Release Note" -->Version __VERSION_NUMBER__
- A whole new Extensions page that shows what has been installed into your Terminal
- Command Palette now shows up in your native language as well as English
- New VT features such as synchronized rendering, new color schemes, configuration for quick mouse actions like zooming, and more
- We've added dozens of settings to the UI that once only existed in the JSON file, including a new page for customizing the layout of your New Tab menu!
- We have rearchitected window management to improve reliability; please file any bugs you encounter with the wt.exe alias
- Profiles now show an icon if they've been hidden or refer to programs which were uninstalled.
Please see our GitHub releases page for additional details.
</ReleaseNotes>

View File

@@ -56,9 +56,9 @@ Este es un proyecto de fuente abierta y animamos a la comunidad a participar. Pa
<ReleaseNotes>
Versión __VERSION_NUMBER__
- Página Extensiones completamente nueva que muestra lo que se ha instalado en tu terminal
- La paleta de comandos ahora se muestra en tu idioma nativo, así como en inglés
- Nuevas características de VT, como la representación sincronizada, nuevos esquemas de color, configuración para acciones rápidas del ratón, como el zoom, y más
- Hemos añadido decenas de configuraciones a la interfaz de usuario que antes solo existían en el archivo JSON, incluida una nueva página para personalizar el diseño del menú Nueva pestaña.
- Hemos reestructurado la gestión de ventanas para mejorar la fiabilidad; informe de cualquier error que encuentre con el alias wt.exe
- Ahora, los perfiles muestran un icono si han sido ocultados o hacen referencia a programas que han sido desinstalados.
Consulte la página de versiones de GitHub para más información.
</ReleaseNotes>

View File

@@ -56,11 +56,11 @@ Il sagit dun projet open source et nous encourageons la participation à l
<ReleaseNotes>
Version __VERSION_NUMBER__
- Une toute nouvelle page Extensions qui affiche ce qui a été installé dans votre Terminal
- La palette de commandes saffiche désormais dans votre langue native, ainsi quen anglais
- De nouvelles fonctionnalités VT, telles que le rendu synchronisé, de nouveaux schémas de couleurs, une configuration pour des actions rapides de la souris comme le zoom, et bien plus encore
- Nous avons ajouté des dizaines de paramètres à linterface utilisateur qui nexistaient auparavant que dans le fichier JSON, y compris une nouvelle page pour personnaliser la disposition de votre menu Nouvel onglet.
- Nous avons fait une refonte de la gestion des fenêtres pour améliorer la fiabilité. Veuillez signaler les bogues que vous rencontrez avec lalias wt.exe.
- Les profils affichent désormais une icône sils ont été masqués ou sils font référence à des programmes qui ont été désinstallés.
Consultez notre page des versions de GitHub pour plus de détails.
Veuillez consulter notre page des versions GitHub pour découvrir dautres détails.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,9 +56,9 @@ Si tratta di un progetto open source e la partecipazione della community è molt
<ReleaseNotes>
Versione __VERSION_NUMBER__
- Una pagina Estensioni completamente nuova che mostra ciò che è stato installato nel terminale
- Il riquadro comandi ora viene visualizzato nella tua lingua di origine oltre che in inglese
- Nuove funzionalità VT come il rendering sincronizzato, le nuove combinazioni di colori, la configurazione per azioni rapide del mouse come lo zoom e altro ancora
- Abbiamo aggiunto decine di impostazioni all'interfaccia utente che in precedenza esistevano solo nel file JSON, inclusa una nuova pagina per personalizzare il layout del menu Nuova scheda.
- Abbiamo riprogettato la gestione delle finestre per migliorarne l'affidabilità; segnala eventuali bug riscontrati con l'alias wt.exe
- I profili ora mostrano un'icona se sono stati nascosti o se fanno riferimento a programmi disinstallati.
Per altri dettagli, vedi la pagina delle release di GitHub.
</ReleaseNotes>

View File

@@ -56,9 +56,9 @@
<ReleaseNotes>
バージョン __VERSION_NUMBER__
- お使いのターミナルに何がインストールされているかを表示する新しい [拡張機能] ページ
- コマンド パレットがネイティブ言語と英語で表示されるようになりました
- 同期レンダリング、新しい配色、ズームなどのクイック マウス操作の構成などの、新しい VT 機能
- 新しいタブ メニューのレイアウトをカスタマイズするための新しいページなど、以前は JSON ファイルにしかなかった設定が UI に多数追加されました。
- 信頼性を向上させるために、ウィンドウ管理を再設計しました。wt.exe エイリアスで発生したバグを報告してください
- プロファイルが非表示になっている場合や、アンインストールされたプログラムを参照している場合に、アイコンが表示されるようになりました。
詳細については、GitHub リリース ページをご覧ください。
</ReleaseNotes>

View File

@@ -56,11 +56,11 @@
<ReleaseNotes>
버전 __VERSION_NUMBER__
- 터미널에 설치된 항목을 보여 주는 완전히 새로운 확장 페이지
- 이제 영어뿐만 아니라 모국어로도 표시되는 명령 팔레트
- 동기화된 렌더링, 새로운 색 구성표, 확대/축소와 같은 빠른 마우스 동작을 위한 구성 등 새로운 VT 기능 추가
- 새 탭 메뉴의 레이아웃을 사용자 지정하기 위한 새 페이지를 포함하여 JSON 파일에만 존재했던 수십 개의 설정을 UI에 추가
- 안정성을 개선하기 위해 창 관리 구조를 재구성했습니다. wt.exe 별칭과 관련하여 발생한 버그 신고
- 프로필이 숨겨졌거나 제거된 프로그램을 참조하는 경우 이제 프로필에 아이콘이 표시됩니다.
자세한 정보는 GitHub 릴리스 페이지를 참하세요.
자세한 내용은 GitHub 릴리스 페이지를 참하세요.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,9 +56,9 @@ Este é um projeto de código aberto e a participação da comunidade é bem-vin
<ReleaseNotes>
Version __VERSION_NUMBER__
Uma nova página de Extensões que mostra o que foi instalado no seu Terminal
A Paleta de Comandos agora aparece no seu idioma nativo, além do inglês
Novos recursos da VT, como renderização sincronizada, novos esquemas de cores, configuração para ações rápidas do mouse, como zoom, e muito mais
Adicionamos várias configurações à interface do usuário que antes só existiam no arquivo JSON, incluindo uma nova página para personalizar o layout do seu menu Nova Guia!
Reestruturamos o gerenciamento de janelas para melhorar a confiabilidade; registre os bugs que você encontrar com o alias wt.exe
Os perfis agora exibem um ícone se estiverem ocultos ou se referirem a programas que foram desinstalados.
Confira nossa página de lançamentos no GitHub para obter mais detalhes.
</ReleaseNotes>

View File

@@ -56,11 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,11 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,11 +56,11 @@
<ReleaseNotes>
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->

View File

@@ -56,9 +56,9 @@
<ReleaseNotes>
Версия __VERSION_NUMBER__
Новая страница расширений, на которой отображается информация о том, что было установлено в вашем терминале
Палитра команд теперь доступна на вашем языке, а также на английском
Новые функции VT, например синхронизированная отрисовка, новые цветовые схемы, настройка быстрых действий мыши, таких как масштабирование, и т. д.
Мы добавили в пользовательский интерфейс десятки параметров, которые ранее существовали только в JSON-файле, включая новую страницу для настройки макета меню новой вкладки.
Мы переработали управление окнами для повышения надежности. Сообщайте о любых ошибках, которые вы обнаружите с псевдонимом wt.exe
Профили теперь отображают значок, если они были скрыты или ссылаются на программы, которые были удалены.
Дополнительные сведения см. на странице выпусков GitHub.
</ReleaseNotes>

View File

@@ -1,181 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ProductDescription language="sr-cyrl-rs" xmlns="http://schemas.microsoft.com/appx/2012/ProductDescription" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" Release="">
<AppStoreName _locID="App_AppStoreName">
<!-- This is optional. AppStoreName is typically extracted from your package's AppxManifest DisplayName property. -->
<!-- Uncomment (and localize) this Store name if your application package does not contain a localization for the DisplayName in this language. -->
<!-- Leaving this uncommented for a language that your application package DOES contain a DisplayName for will result in a submission failure with the API. -->
<!-- _locComment_text="{MaxLength=200} App AppStoreName" -->
<!-- Windows Terminal -->
</AppStoreName>
<Keywords>
<!-- Valid length: 30 character limit, up to 7 elements -->
<Keyword _locID="App_keyword1">
<!-- _locComment_text="{MaxLength=30} App keyword 1" -->Терминал</Keyword>
<Keyword _locID="App_keyword2">
<!-- _locComment_text="{MaxLength=30} App keyword 2" -->Конзола</Keyword>
<Keyword _locID="App_keyword3">
<!-- _locComment_text="{MaxLength=30} App keyword 3" -->
</Keyword>
<Keyword _locID="App_keyword4">
<!-- _locComment_text="{MaxLength=30} App keyword 4" -->
</Keyword>
<Keyword _locID="App_keyword5">
<!-- _locComment_text="{MaxLength=30} App keyword 5" -->
</Keyword>
<Keyword _locID="App_keyword6">
<!-- _locComment_text="{MaxLength=30} App keyword 6" -->
</Keyword>
<Keyword _locID="App_keyword7">
<!-- _locComment_text="{MaxLength=30} App keyword 7" -->
</Keyword>
</Keywords>
<Description _locID="App_Description">
<!-- _locComment_text="{MaxLength=10000} App Description" -->Windows терминал је модерна, брза, ефикасна, моћна и продуктивна апликација терминала за кориснике алата из командне линије и љуски као што су Command Prompt, PowerShell, и WSL. Неке од његових главних функционалности су вишеструке картице, панели, подршка за Уникод и UTF-8, GPU убрзани механизам за исцртавање текста, произвољне теме, стилови и конфигурације.
Ово је пројекат отвореног кода и учешће заједнице је добродошло. Ако желите да учествујете, молимо вас да посетите https://github.com/microsoft/terminal </Description>
<ShortDescription _locID="App_ShortDescription">
<!-- Only used for games. This description appears in the Information section of the Game Hub on Xbox One, and helps customers understand more about your game. -->
<!-- _locComment_text="{MaxLength=500} App ShortDescription" -->
</ShortDescription>
<ShortTitle _locID="App_ShortTitle">
<!-- A shorter version of your product's name. If provided, this shorter name may appear in various places on Xbox One (during installation, in Achievements, etc.) in place of the full title of your product. -->
<!-- _locComment_text="{MaxLength=50} App ShortTitle" -->
</ShortTitle>
<SortTitle _locID="App_SortTitle">
<!-- If your product could be alphabetized in different ways, you can enter another version here. This may help customers find the product more quickly when searching. -->
<!-- _locComment_text="{MaxLength=255} App SortTitle" -->
</SortTitle>
<VoiceTitle _locID="App_VoiceTitle">
<!-- An alternate name for your product that, if provided, may be used in the audio experience on Xbox One when using Kinect or a headset. -->
<!-- _locComment_text="{MaxLength=255} App VoiceTitle" -->
</VoiceTitle>
<DevStudio _locID="App_DevStudio">
<!-- Specify this value if you want to include a "Developed by" field in the listing. (The "Published by" field will list the publisher display name associated with your account, whether or not you provide a devStudio value.) -->
<!-- _locComment_text="{MaxLength=255} App DevStudio" -->
</DevStudio>
<ReleaseNotes _locID="App_ReleaseNotes">
<!-- _locComment_text="{MaxLength=1500} {Locked=__VERSION_NUMBER__}{Locked=wt.exe} App Release Note" -->Верзија __VERSION_NUMBER__
- Попуно нова страница Проширења која приказује шта је све инсталирано у ваш Терминал
- Палета команди се сада приказује и на вашем матерњем језику, као и на енглеском
- Нове VT функционалности као што су синхронизовано исцртавање, нове шеме боја, конфигурација за брзе акције мишем, као што је зумирање, и још тога
За више детаља, молимо вас да посетите нашу GitHub страницу издања.
</ReleaseNotes>
<ScreenshotCaptions>
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
<!-- Valid attributes: any of DesktopImage, MobileImage, XboxImage, SurfaceHubImage, and HoloLensImage -->
<Caption DesktopImage="acrylic-emoji.png" _locID="App_caption1">
<!-- _locComment_text="{MaxLength=200} Screenshot caption 1" -->
</Caption>
<Caption DesktopImage="panes.png" _locID="App_caption2">
<!-- _locComment_text="{MaxLength=200} Screenshot caption 2" -->
</Caption>
<Caption DesktopImage="htop.png" _locID="App_caption3">
<!-- _locComment_text="{MaxLength=200} Screenshot caption 3" -->
</Caption>
</ScreenshotCaptions>
<AdditionalAssets>
<!-- Valid elements:-->
<!-- HeroImage414x180, HeroImage846x468, HeroImage558x756, HeroImage414x468, HeroImage558x558, HeroImage2400x1200,-->
<!-- ScreenshotWXGA, ScreenshotHD720, ScreenshotWVGA, Doublewide, Panoramic, Square,-->
<!-- SmallMobileTile, SmallXboxLiveTile, LargeMobileTile, LargeXboxLiveTile, Tile,-->
<!-- DesktopIcon, Icon (use this value for the 1:1 300x300 pixels logo), AchievementIcon,-->
<!-- ChallengePromoIcon, RewardDisplayIcon, Icon150X150, Icon71X71,-->
<!-- BoxArt, BrandedKeyArt, PosterArt, FeaturedPromotionalArt, PromotionalArt16x9, TitledHeroArt-->
<!-- There is no content for any of these elements, just a single attribute called FileName. -->
<PosterArt FileName="Store Poster Art.png" />
<BoxArt FileName="Store Box Art.png" />
<PromotionalArt16x9 FileName="Store Thumbnail.png" />
</AdditionalAssets>
<Trailers>
<!-- Maximum number of trailers permitted: 15 -->
<Trailer FileName="CC0605_CommandLine_Teaser_WEB_MASTER_H264_1080p_23.976_-16LKFS_-3dbTP_ST.mp4">
<Title _locID="App_trailerTitle1">
<!-- _locComment_text="{MaxLength=255} Trailer title 1" -->Нови Windows терминал</Title>
<Images>
<!-- Current maximum of 1 image per trailer permitted. -->
<Image FileName="Store Thumbnail.png">
<!-- _locComment_text="{Locked} Trailer screenshot 1 description" -->
</Image>
</Images>
</Trailer>
</Trailers>
<AppFeatures>
<!-- Valid length: 200 character limit, up to 20 elements -->
<AppFeature _locID="App_feature1">
<!-- _locComment_text="{MaxLength=200} App Feature 1" -->Вишеструке картице</AppFeature>
<AppFeature _locID="App_feature2">
<!-- _locComment_text="{MaxLength=200} App Feature 2" -->Пуна Уникод подршка</AppFeature>
<AppFeature _locID="App_feature3">
<!-- _locComment_text="{MaxLength=200} App Feature 3" -->GPU-убрзано исцртавање текста</AppFeature>
<AppFeature _locID="App_feature4">
<!-- _locComment_text="{MaxLength=200} App Feature 4" -->Потпуна прилагодљивост</AppFeature>
<AppFeature _locID="App_feature5">
<!-- _locComment_text="{MaxLength=200} App Feature 5" -->Подела панела</AppFeature>
<AppFeature _locID="App_feature6">
<!-- _locComment_text="{MaxLength=200} App Feature 6" -->
</AppFeature>
<AppFeature _locID="App_feature7">
<!-- _locComment_text="{MaxLength=200} App Feature 7" -->
</AppFeature>
<AppFeature _locID="App_feature8">
<!-- _locComment_text="{MaxLength=200} App Feature 8" -->
</AppFeature>
<AppFeature _locID="App_feature9">
<!-- _locComment_text="{MaxLength=200} App Feature 9" -->
</AppFeature>
<AppFeature _locID="App_feature10">
<!-- _locComment_text="{MaxLength=200} App Feature 10" -->
</AppFeature>
<AppFeature _locID="App_feature11">
<!-- _locComment_text="{MaxLength=200} App Feature 11" -->
</AppFeature>
<AppFeature _locID="App_feature12">
<!-- _locComment_text="{MaxLength=200} App Feature 12" -->
</AppFeature>
<AppFeature _locID="App_feature13">
<!-- _locComment_text="{MaxLength=200} App Feature 13" -->
</AppFeature>
<AppFeature _locID="App_feature14">
<!-- _locComment_text="{MaxLength=200} App Feature 14" -->
</AppFeature>
<AppFeature _locID="App_feature15">
<!-- _locComment_text="{MaxLength=200} App Feature 15" -->
</AppFeature>
<AppFeature _locID="App_feature16">
<!-- _locComment_text="{MaxLength=200} App Feature 16" -->
</AppFeature>
<AppFeature _locID="App_feature17">
<!-- _locComment_text="{MaxLength=200} App Feature 17" -->
</AppFeature>
<AppFeature _locID="App_feature18">
<!-- _locComment_text="{MaxLength=200} App Feature 18" -->
</AppFeature>
<AppFeature _locID="App_feature19">
<!-- _locComment_text="{MaxLength=200} App Feature 19" -->
</AppFeature>
<AppFeature _locID="App_feature20">
<!-- _locComment_text="{MaxLength=200} App Feature 20" -->
</AppFeature>
</AppFeatures>
<RecommendedHardware>
<!-- Valid length: 200 character limit, up to 11 elements -->
<Recommendation _locID="App_RecommendedHW1">
<!-- _locComment_text="{MaxLength=200} App Recommended Hardware 1" -->Тастатура</Recommendation>
</RecommendedHardware>
<MinimumHardware>
<!-- Valid length: 200 character limit, up to 11 elements -->
</MinimumHardware>
<CopyrightAndTrademark _locID="App_CopyrightandTrademark">
<!-- _locComment_text="{MaxLength=200} Copyright and Trademark" -->Copyright (c) Microsoft Corporation</CopyrightAndTrademark>
<AdditionalLicenseTerms _locID="App_AdditionalLicenseTerms">
<!-- _locComment_text="{MaxLength=10000} Additional License Terms" -->
</AdditionalLicenseTerms>
<WebsiteURL _locID="App_WebsiteURL">
<!-- _locComment_text="{MaxLength=2048} WebsiteURL" -->https://github.com/microsoft/terminal</WebsiteURL>
<SupportContactInfo _locID="App_SupportContactInfo">
<!-- _locComment_text="{MaxLength=2048} Support Contact Info" -->https://github.com/microsoft/terminal/issues/new</SupportContactInfo>
<PrivacyPolicyURL _locID="App_PrivacyURL">
<!-- _locComment_text="{MaxLength=2048} Privacy Policy URL" -->https://go.microsoft.com/fwlink/?LinkID=521839</PrivacyPolicyURL>
</ProductDescription>

View File

@@ -56,9 +56,9 @@
<ReleaseNotes _locID="App_ReleaseNotes">
<!-- _locComment_text="{MaxLength=1500} {Locked=__VERSION_NUMBER__}{Locked=wt.exe} App Release Note" -->Версія __VERSION_NUMBER__
- Цілком нова сторінка розширень, яка показує, що було встановлено у вашому Терміналі
- Палітра команд тепер відображається вашою рідною мовою, так само, як і англійською
- Нові VT функції, такі як синхронізований рендеринг, нові колірні схеми, налаштування для швидких дій миші, таких як масштабування, тощо
- Ми додали десятки налаштувань до інтерфейсу користувача, які раніше існували лише у файлі JSON, включаючи нову сторінку для налаштування макета меню «Нова вкладка»!
- Ми переробили архітектуру керування вікнами для підвищення надійності; будь ласка, повідомляйте про будь-які помилки, з якими ви зіткнулися, за допомогою псевдоніма wt.exe.
- Профілі тепер відображають значок, якщо вони були приховані, або посилаються на програми, які було видалено.
Будь ласка, перегляньте нашу сторінку релізів GitHub для отримання додаткової інформації.
</ReleaseNotes>

View File

@@ -56,9 +56,9 @@
<ReleaseNotes>
Version __VERSION_NUMBER__
- 一个全新的“扩展”页,显示已安装到终端的内容
- 命令面板现在以你的母语和英语显示
- 新的 VT 功能,例如同步渲染、新配色方案、快速鼠标操作(如缩放)的配置等
- 我们向用户界面添加了许多之前仅存在于 JSON 文件中的设置,包括用于自定义“新建标签页”菜单布局的新页面!
- 我们已重新架构窗口管理以提高可靠性; 请使用 wt.exe 别名提交您遇到的任何错误
- 配置文件如果已被隐藏或引用了已卸载的程序,现在会显示一个图标。
有关其他详细信息,请参阅我们的 GitHub 发布页面。
</ReleaseNotes>

View File

@@ -56,9 +56,9 @@
<ReleaseNotes>
Version __VERSION_NUMBER__
- 全新的延伸模組頁面會顯示已安裝在您終端機中的內容
- 命令選擇區現在以您的母語和英文顯示
- 新的 VT 功能,例如同步轉譯、新的色彩配置、快速滑鼠動作 (例如縮放) 設定等等
- 我們已在使用者介面中新增數十個曾經僅存在於 JSON 檔案中的設定,包括一個可自訂新索引標籤選單版面配置的新頁面!
- 我們已重新架構視窗管理以提升可靠性; 如果您在使用 wt.exe 別名時遇到任何錯誤,請提交錯誤回報
- 如果設定檔已隱藏或參照已解除安裝的程式,現在會顯示圖示。
如需更多詳細資料,請參閱我們的 GitHub 發行版本頁面。
</ReleaseNotes>

View File

@@ -46,7 +46,6 @@ jobs:
BuildConfiguration: ${{ config }}
dependsOn: ${{ parameters.dependsOn }}
variables:
BuildPlatform: Any CPU
OutputBuildPlatform: AnyCPU
Terminal.BinDir: $(Build.SourcesDirectory)/bin/$(OutputBuildPlatform)/$(BuildConfiguration)
JobOutputDirectory: $(Build.ArtifactStagingDirectory)\nupkg

View File

@@ -211,7 +211,7 @@ extends:
ob_createvpack_verbose: true
ob_createvpack_vpackdirectory: '$(JobOutputDirectory)\vpack'
ob_createvpack_versionAs: string
ob_createvpack_version: '$(XES_PACKAGEVERSIONNUMBER)'
ob_createvpack_version: '$(XES_APPXMANIFESTVERSION)'
ob_updateOSManifest_gitcheckinConfigPath: '$(Build.SourcesDirectory)\build\config\GitCheckin.json'
# We're skipping the 'fetch' part of the OneBranch rules, but that doesn't mean
# that it doesn't expect to have downloaded a manifest directly to some 'destination'

View File

@@ -3,9 +3,9 @@
<!-- This file is read by XES, which we use in our Release builds. -->
<PropertyGroup Label="Version">
<XesUseOneStoreVersioning>true</XesUseOneStoreVersioning>
<XesBaseYearForStoreVersion>2026</XesBaseYearForStoreVersion>
<XesBaseYearForStoreVersion>2025</XesBaseYearForStoreVersion>
<VersionMajor>1</VersionMajor>
<VersionMinor>26</VersionMinor>
<VersionMinor>25</VersionMinor>
<VersionInfoProductName>Windows Terminal</VersionInfoProductName>
<VersionInfoCulture>1033</VersionInfoCulture>
<!-- The default has a spacing problem -->

View File

@@ -60,8 +60,7 @@
"enum": [
"audible",
"window",
"taskbar",
"notification"
"taskbar"
]
}
},
@@ -71,7 +70,6 @@
"audible",
"taskbar",
"window",
"notification",
"all",
"none"
]
@@ -2409,14 +2407,6 @@
"console"
]
},
"compatibility.ambiguousWidth": {
"default": "narrow",
"description": "Controls the cell width of East Asian Ambiguous characters.",
"enum": [
"narrow",
"wide"
]
},
"copyFormatting": {
"default": true,
"description": "When set to `true`, the color and font formatting of selected text is also copied to your clipboard. When set to `false`, only plain text is copied to your clipboard. An array of specific formats can also be used. Supported array values include `html` and `rtf`. Plain text is always copied.",
@@ -2656,21 +2646,10 @@
"type": "string"
},
"warning.confirmCloseAllTabs": {
"deprecated": true,
"description": "[Deprecated] Use \"warning.confirmOnClose\" instead.",
"default": true,
"description": "When set to \"true\" closing a window with multiple tabs open will require confirmation. When set to \"false\", the confirmation dialog will not appear.",
"type": "boolean"
},
"warning.confirmOnClose": {
"default": "automatic",
"description": "Controls when a confirmation dialog appears before closing tabs or windows.",
"enum": [
"never",
"automatic",
"always"
],
"type": "string"
},
"useTabSwitcher": {
"description": "[Deprecated] Replaced with the \"tabSwitcherMode\" setting.",
"default": true,
@@ -2787,11 +2766,6 @@
"description": "When set to true, VT applications will be allowed to set the contents of the local clipboard using OSC 52 (Manipulate Selection Data).",
"type": "boolean"
},
"compatibility.allowOSC777": {
"default": true,
"description": "When set to true, applications can send OSC 777 escape sequences to trigger desktop toast notifications with a custom title and body.",
"type": "boolean"
},
"unfocusedAppearance": {
"$ref": "#/$defs/AppearanceConfig",
"description": "Sets the appearance of the terminal when it is unfocused.",
@@ -2867,78 +2841,6 @@
"description": "Sets the sound played when the application emits a BEL. When set to an array, the terminal will pick one of those sounds at random.",
"$ref": "#/$defs/BellSound"
},
"notifyOnInactiveOutput": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string",
"enum": [
"taskbar",
"audible",
"tab",
"notification"
]
}
},
{
"type": "string",
"enum": [
"taskbar",
"audible",
"tab",
"notification",
"all",
"none"
]
}
],
"description": "Controls how you are notified when an inactive tab produces new output."
},
"notifyOnNextPrompt": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string",
"enum": [
"taskbar",
"audible",
"tab",
"notification"
]
}
},
{
"type": "string",
"enum": [
"taskbar",
"audible",
"tab",
"notification",
"all",
"none"
]
}
],
"description": "Controls how you are notified when a new shell prompt is detected. Requires shell integration."
},
"autoDetectRunningCommand": {
"default": "disabled",
"description": "Automatically detect when a command is running and show a progress indicator in the tab and taskbar.",
"enum": [
"disabled",
"automatic",
"progress"
],
"type": "string"
},
"closeOnExit": {
"default": "automatic",
"description": "Sets how the profile reacts to termination or failure to launch. Possible values:\n -\"graceful\" (close when exit is typed or the process exits normally)\n -\"always\" (always close)\n -\"automatic\" (behave as \"graceful\" only for processes launched by terminal, behave as \"always\" otherwise)\n -\"never\" (never close).\ntrue and false are accepted as synonyms for \"graceful\" and \"never\" respectively.",
@@ -3264,11 +3166,6 @@
"mingw"
],
"type": "string"
},
"dragDropDelimiter": {
"default": " ",
"description": "The delimiter used when dropping multiple files onto the terminal.",
"type": "string"
}
}
},

View File

@@ -390,9 +390,6 @@ Microsoft::Console::ICU::unique_utext Microsoft::Console::ICU::UTextFromTextBuff
utext_setup(&ut, 0, &status);
FAIL_FAST_IF(status > U_ZERO_ERROR);
rowBeg = std::max<til::CoordType>(0, rowBeg);
rowEnd = std::min(textBuffer.GetSize().BottomExclusive(), rowEnd);
ut.providerProperties = (1 << UTEXT_PROVIDER_LENGTH_IS_EXPENSIVE) | (1 << UTEXT_PROVIDER_STABLE_CHUNKS);
ut.pFuncs = &utextFuncs;
ut.context = &textBuffer;

View File

@@ -219,17 +219,6 @@ til::CoordType TextBuffer::_estimateOffsetOfLastCommittedRow() const noexcept
return std::max(0, gsl::narrow_cast<til::CoordType>(lastRowOffset - 2));
}
bool TextBuffer::_isRowCommitted(til::CoordType y) const noexcept
{
auto offset = (_firstRow + y + 1 /* account for the scratch row */) % _height;
if (offset < 0)
{
offset += _height;
}
const auto row = _buffer.get() + _bufferRowStride * offset;
return row < _commitWatermark;
}
// Retrieves a row from the buffer by its offset from the first row of the text buffer
// (what corresponds to the top row of the screen buffer).
const ROW& TextBuffer::GetRowByOffset(const til::CoordType index) const
@@ -945,10 +934,6 @@ void TextBuffer::ResetLineRenditionRange(const til::CoordType startRow, const ti
LineRendition TextBuffer::GetLineRendition(const til::CoordType row) const
{
if (!_isRowCommitted(row)) [[unlikely]]
{
return LineRendition::SingleWidth;
}
return GetRowByOffset(row).GetLineRendition();
}
@@ -1156,20 +1141,7 @@ DelimiterClass TextBuffer::_GetDelimiterClassAt(const til::point pos, const std:
return GetRowByOffset(realPos.y).DelimiterClassAt(realPos.x, wordDelimiters);
}
// Method Description:
// - Get the start of the word at or before the given position
// - When includeWhitespace is false, returns the start of the current delimiter class run
// (selection behavior: stops at non-wrapped row boundaries)
// - When includeWhitespace is true, also skips backward past any leading ControlChars
// to include the preceding word (accessibility/UIA behavior: crosses all row boundaries)
// Arguments:
// - pos - the buffer position to start from
// - wordDelimiters - characters considered as DelimiterClass::DelimiterChar
// - includeWhitespace - when true, skip past leading whitespace to find the word start
// - limitOptional - (optional) the last possible position in the buffer that can be explored
// Return Value:
// - The position of the first character of the word (inclusive)
til::point TextBuffer::GetWordStart(til::point pos, const std::wstring_view wordDelimiters, bool includeWhitespace, std::optional<til::point> limitOptional) const
til::point TextBuffer::GetWordStart2(til::point pos, const std::wstring_view wordDelimiters, bool includeWhitespace, std::optional<til::point> limitOptional) const
{
const auto bufferSize{ GetSize() };
const auto limit{ limitOptional.value_or(bufferSize.BottomInclusiveRightExclusive()) };
@@ -1202,7 +1174,7 @@ til::point TextBuffer::GetWordStart(til::point pos, const std::wstring_view word
// 1. move to the beginning of the delimiter class run
// 2. (includeWhitespace) if we were on a ControlChar, go back one more delimiter class run
const auto initialDelimiter = bufferSize.IsInBounds(pos) ? _GetDelimiterClassAt(pos, wordDelimiters) : DelimiterClass::ControlChar;
pos = _GetDelimiterClassRunStart(pos, wordDelimiters, includeWhitespace);
pos = _GetDelimiterClassRunStart(pos, wordDelimiters);
if (!includeWhitespace || pos.x == bufferSize.Left())
{
// Special case:
@@ -1213,26 +1185,12 @@ til::point TextBuffer::GetWordStart(til::point pos, const std::wstring_view word
else if (initialDelimiter == DelimiterClass::ControlChar)
{
bufferSize.DecrementInExclusiveBounds(pos);
pos = _GetDelimiterClassRunStart(pos, wordDelimiters, includeWhitespace);
pos = _GetDelimiterClassRunStart(pos, wordDelimiters);
}
return pos;
}
// Method Description:
// - Get the exclusive end of the word at or after the given position
// - When includeWhitespace is false, returns the exclusive end of the current delimiter class run
// (selection behavior: stops at non-wrapped row boundaries)
// - When includeWhitespace is true, also skips forward past any trailing ControlChars
// to include trailing whitespace (accessibility/UIA behavior: crosses all row boundaries)
// - The result is clamped to limitOptional when provided
// Arguments:
// - pos - the buffer position to start from
// - wordDelimiters - characters considered as DelimiterClass::DelimiterChar
// - includeWhitespace - when true, skip past trailing whitespace to find the next word boundary
// - limitOptional - (optional) the last possible position in the buffer that can be explored
// Return Value:
// - The exclusive end position of the word
til::point TextBuffer::GetWordEnd(til::point pos, const std::wstring_view wordDelimiters, bool includeWhitespace, std::optional<til::point> limitOptional) const
til::point TextBuffer::GetWordEnd2(til::point pos, const std::wstring_view wordDelimiters, bool includeWhitespace, std::optional<til::point> limitOptional) const
{
const auto bufferSize{ GetSize() };
const auto limit{ limitOptional.value_or(bufferSize.BottomInclusiveRightExclusive()) };
@@ -1265,12 +1223,8 @@ til::point TextBuffer::GetWordEnd(til::point pos, const std::wstring_view wordDe
// So the heuristic we use is:
// 1. move to the end of the delimiter class run
// 2. (includeWhitespace) if the next delimiter class run is a ControlChar, go forward one more delimiter class run
pos = _GetDelimiterClassRunEnd(pos, wordDelimiters, includeWhitespace);
if (pos >= limit)
{
return limit;
}
else if (!includeWhitespace || pos.x == bufferSize.RightExclusive())
pos = _GetDelimiterClassRunEnd(pos, wordDelimiters);
if (!includeWhitespace || pos.x == bufferSize.RightExclusive())
{
// Special case:
// we're at the right boundary (and end of a delimiter class run),
@@ -1281,8 +1235,7 @@ til::point TextBuffer::GetWordEnd(til::point pos, const std::wstring_view wordDe
if (const auto nextDelimClass = bufferSize.IsInBounds(pos) ? _GetDelimiterClassAt(pos, wordDelimiters) : DelimiterClass::ControlChar;
nextDelimClass == DelimiterClass::ControlChar)
{
pos = _GetDelimiterClassRunEnd(pos, wordDelimiters, includeWhitespace);
return std::min(pos, limit);
return _GetDelimiterClassRunEnd(pos, wordDelimiters);
}
return pos;
}
@@ -1335,48 +1288,29 @@ bool TextBuffer::IsWordBoundary(const til::point pos, const std::wstring_view wo
return prevDelimiterClass != currentDelimiterClass && currentDelimiterClass != DelimiterClass::ControlChar;
}
// Method Description:
// - Get the start position for the current delimiter class run, scanning backward
// - Stops when the delimiter class changes or a row boundary is reached
// - When accessibilityMode is true, freely crosses non-wrapped row boundaries
// - When accessibilityMode is false, only crosses wrap-forced row boundaries
// Arguments:
// - pos - the buffer position to start scanning from
// - wordDelimiters - what characters are we considering for the separation of words
// - accessibilityMode - when true, cross non-wrapped row boundaries freely
// Return Value:
// - The position of the first character in the current delimiter class run (inclusive)
til::point TextBuffer::_GetDelimiterClassRunStart(til::point pos, const std::wstring_view wordDelimiters, const bool accessibilityMode) const
til::point TextBuffer::_GetDelimiterClassRunStart(til::point pos, const std::wstring_view wordDelimiters) const
{
const auto bufferSize = GetSize();
const auto initialDelimClass = bufferSize.IsInBounds(pos) ? _GetDelimiterClassAt(pos, wordDelimiters) : DelimiterClass::ControlChar;
auto nextPos = pos;
while (nextPos != bufferSize.Origin())
for (auto nextPos = pos; nextPos != bufferSize.Origin(); pos = nextPos)
{
bufferSize.DecrementInExclusiveBounds(nextPos);
if (nextPos.x == bufferSize.RightExclusive())
{
// wrapped onto previous line
// wrapped onto previous line,
// check if it was forced to wrap
const auto& row = GetRowByOffset(nextPos.y);
if (!row.WasWrapForced() && !accessibilityMode)
if (!row.WasWrapForced())
{
return pos;
}
// In accessibility mode (or if row was wrap-forced), continue
// across the row boundary. The actual last character of the
// previous row will be checked on the next iteration.
// Don't update pos to avoid storing a transient position
}
else if (_GetDelimiterClassAt(nextPos, wordDelimiters) != initialDelimClass)
{
// if we changed delim class, we're done (don't apply move)
return pos;
}
else
{
pos = nextPos;
}
}
return pos;
}
@@ -1386,8 +1320,7 @@ til::point TextBuffer::_GetDelimiterClassRunStart(til::point pos, const std::wst
// Arguments:
// - pos - the buffer position being within the current delimiter class
// - wordDelimiters - what characters are we considering for the separation of words
// - accessibilityMode - when true, cross non-wrapped row boundaries freely
til::point TextBuffer::_GetDelimiterClassRunEnd(til::point pos, const std::wstring_view wordDelimiters, const bool accessibilityMode) const
til::point TextBuffer::_GetDelimiterClassRunEnd(til::point pos, const std::wstring_view wordDelimiters) const
{
const auto bufferSize = GetSize();
const auto initialDelimClass = bufferSize.IsInBounds(pos) ? _GetDelimiterClassAt(pos, wordDelimiters) : DelimiterClass::ControlChar;
@@ -1400,16 +1333,7 @@ til::point TextBuffer::_GetDelimiterClassRunEnd(til::point pos, const std::wstri
// wrapped onto next line,
// check if it was forced to wrap or switched delimiter class
const auto& row = GetRowByOffset(pos.y);
if (accessibilityMode)
{
// In accessibility mode, always cross row boundaries,
// but still stop if the delimiter class changes
if (_GetDelimiterClassAt(nextPos, wordDelimiters) != initialDelimClass)
{
return nextPos;
}
}
else if (!row.WasWrapForced() || _GetDelimiterClassAt(nextPos, wordDelimiters) != initialDelimClass)
if (!row.WasWrapForced() || _GetDelimiterClassAt(nextPos, wordDelimiters) != initialDelimClass)
{
return pos;
}
@@ -1424,6 +1348,283 @@ til::point TextBuffer::_GetDelimiterClassRunEnd(til::point pos, const std::wstri
return pos;
}
// Method Description:
// - Get the til::point for the beginning of the word you are on
// Arguments:
// - target - a til::point on the word you are currently on
// - wordDelimiters - what characters are we considering for the separation of words
// - accessibilityMode - when enabled, we continue expanding left until we are at the beginning of a readable word.
// Otherwise, expand left until a character of a new delimiter class is found
// (or a row boundary is encountered)
// - limitOptional - (optional) the last possible position in the buffer that can be explored. This can be used to improve performance.
// Return Value:
// - The til::point for the first character on the "word" (inclusive)
til::point TextBuffer::GetWordStart(const til::point target, const std::wstring_view wordDelimiters, bool accessibilityMode, std::optional<til::point> limitOptional) const
{
// Consider a buffer with this text in it:
// " word other "
// In selection (accessibilityMode = false),
// a "word" is defined as the range between two delimiters
// so the words in the example include [" ", "word", " ", "other", " "]
// In accessibility (accessibilityMode = true),
// a "word" includes the delimiters after a range of readable characters
// so the words in the example include ["word ", "other "]
// NOTE: the start anchor (this one) is inclusive, whereas the end anchor (GetWordEnd) is exclusive
#pragma warning(suppress : 26496)
auto copy{ target };
const auto bufferSize{ GetSize() };
const auto limit{ limitOptional.value_or(bufferSize.EndExclusive()) };
if (target == bufferSize.Origin())
{
// can't expand left
return target;
}
else if (target == bufferSize.EndExclusive())
{
// GH#7664: Treat EndExclusive as EndInclusive so
// that it actually points to a space in the buffer
copy = bufferSize.BottomRightInclusive();
}
else if (bufferSize.CompareInBounds(target, limit, true) >= 0)
{
// if at/past the limit --> clamp to limit
copy = limitOptional.value_or(bufferSize.BottomRightInclusive());
}
if (accessibilityMode)
{
return _GetWordStartForAccessibility(copy, wordDelimiters);
}
else
{
return _GetWordStartForSelection(copy, wordDelimiters);
}
}
// Method Description:
// - Helper method for GetWordStart(). Get the til::point for the beginning of the word (accessibility definition) you are on
// Arguments:
// - target - a til::point on the word you are currently on
// - wordDelimiters - what characters are we considering for the separation of words
// Return Value:
// - The til::point for the first character on the current/previous READABLE "word" (inclusive)
til::point TextBuffer::_GetWordStartForAccessibility(const til::point target, const std::wstring_view wordDelimiters) const
{
auto result = target;
const auto bufferSize = GetSize();
// ignore left boundary. Continue until readable text found
while (_GetDelimiterClassAt(result, wordDelimiters) != DelimiterClass::RegularChar)
{
if (result == bufferSize.Origin())
{
//looped around and hit origin (no word between origin and target)
return result;
}
bufferSize.DecrementInBounds(result);
}
// make sure we expand to the left boundary or the beginning of the word
while (_GetDelimiterClassAt(result, wordDelimiters) == DelimiterClass::RegularChar)
{
if (result == bufferSize.Origin())
{
// first char in buffer is a RegularChar
// we can't move any further back
return result;
}
bufferSize.DecrementInBounds(result);
}
// move off of delimiter
bufferSize.IncrementInBounds(result);
return result;
}
// Method Description:
// - Helper method for GetWordStart(). Get the til::point for the beginning of the word (selection definition) you are on
// Arguments:
// - target - a til::point on the word you are currently on
// - wordDelimiters - what characters are we considering for the separation of words
// Return Value:
// - The til::point for the first character on the current word or delimiter run (stopped by the left margin)
til::point TextBuffer::_GetWordStartForSelection(const til::point target, const std::wstring_view wordDelimiters) const
{
auto result = target;
const auto bufferSize = GetSize();
const auto initialDelimiter = _GetDelimiterClassAt(result, wordDelimiters);
const bool isControlChar = initialDelimiter == DelimiterClass::ControlChar;
// expand left until we hit the left boundary or a different delimiter class
while (result != bufferSize.Origin() && _GetDelimiterClassAt(result, wordDelimiters) == initialDelimiter)
{
if (result.x == bufferSize.Left())
{
// Prevent wrapping to the previous line if the selection begins on whitespace
if (isControlChar)
{
break;
}
if (result.y > 0)
{
// Prevent wrapping to the previous line if it was hard-wrapped (e.g. not forced by us to wrap)
const auto& priorRow = GetRowByOffset(result.y - 1);
if (!priorRow.WasWrapForced())
{
break;
}
}
}
bufferSize.DecrementInBounds(result);
}
if (_GetDelimiterClassAt(result, wordDelimiters) != initialDelimiter)
{
// move off of delimiter
bufferSize.IncrementInBounds(result);
}
return result;
}
// Method Description:
// - Get the til::point for the beginning of the NEXT word
// Arguments:
// - target - a til::point on the word you are currently on
// - wordDelimiters - what characters are we considering for the separation of words
// - accessibilityMode - when enabled, we continue expanding right until we are at the beginning of the next READABLE word
// Otherwise, expand right until a character of a new delimiter class is found
// (or a row boundary is encountered)
// - limitOptional - (optional) the last possible position in the buffer that can be explored. This can be used to improve performance.
// Return Value:
// - The til::point for the last character on the "word" (inclusive)
til::point TextBuffer::GetWordEnd(const til::point target, const std::wstring_view wordDelimiters, bool accessibilityMode, std::optional<til::point> limitOptional) const
{
// Consider a buffer with this text in it:
// " word other "
// In selection (accessibilityMode = false),
// a "word" is defined as the range between two delimiters
// so the words in the example include [" ", "word", " ", "other", " "]
// In accessibility (accessibilityMode = true),
// a "word" includes the delimiters after a range of readable characters
// so the words in the example include ["word ", "other "]
// NOTE: the end anchor (this one) is exclusive, whereas the start anchor (GetWordStart) is inclusive
// Already at/past the limit. Can't move forward.
const auto bufferSize{ GetSize() };
const auto limit{ limitOptional.value_or(bufferSize.EndExclusive()) };
if (bufferSize.CompareInBounds(target, limit, true) >= 0)
{
return target;
}
if (accessibilityMode)
{
return _GetWordEndForAccessibility(target, wordDelimiters, limit);
}
else
{
return _GetWordEndForSelection(target, wordDelimiters);
}
}
// Method Description:
// - Helper method for GetWordEnd(). Get the til::point for the beginning of the next READABLE word
// Arguments:
// - target - a til::point on the word you are currently on
// - wordDelimiters - what characters are we considering for the separation of words
// - limit - the last "valid" position in the text buffer (to improve performance)
// Return Value:
// - The til::point for the first character of the next readable "word". If no next word, return one past the end of the buffer
til::point TextBuffer::_GetWordEndForAccessibility(const til::point target, const std::wstring_view wordDelimiters, const til::point limit) const
{
const auto bufferSize{ GetSize() };
auto result{ target };
if (bufferSize.CompareInBounds(target, limit, true) >= 0)
{
// if we're already on/past the last RegularChar,
// clamp result to that position
result = limit;
// make the result exclusive
bufferSize.IncrementInBounds(result, true);
}
else
{
while (result != limit && result != bufferSize.BottomRightInclusive() && _GetDelimiterClassAt(result, wordDelimiters) == DelimiterClass::RegularChar)
{
// Iterate through readable text
bufferSize.IncrementInBounds(result);
}
while (result != limit && result != bufferSize.BottomRightInclusive() && _GetDelimiterClassAt(result, wordDelimiters) != DelimiterClass::RegularChar)
{
// expand to the beginning of the NEXT word
bufferSize.IncrementInBounds(result);
}
// Special case: we tried to move one past the end of the buffer
// Manually increment onto the EndExclusive point.
if (result == bufferSize.BottomRightInclusive())
{
bufferSize.IncrementInBounds(result, true);
}
}
return result;
}
// Method Description:
// - Helper method for GetWordEnd(). Get the til::point for the beginning of the NEXT word
// Arguments:
// - target - a til::point on the word you are currently on
// - wordDelimiters - what characters are we considering for the separation of words
// Return Value:
// - The til::point for the last character of the current word or delimiter run (stopped by right margin)
til::point TextBuffer::_GetWordEndForSelection(const til::point target, const std::wstring_view wordDelimiters) const
{
const auto bufferSize = GetSize();
auto result = target;
const auto initialDelimiter = _GetDelimiterClassAt(result, wordDelimiters);
const bool isControlChar = initialDelimiter == DelimiterClass::ControlChar;
// expand right until we hit the right boundary as a ControlChar or a different delimiter class
while (result != bufferSize.BottomRightInclusive() && _GetDelimiterClassAt(result, wordDelimiters) == initialDelimiter)
{
if (result.x == bufferSize.RightInclusive())
{
// Prevent wrapping to the next line if the selection begins on whitespace
if (isControlChar)
{
break;
}
// Prevent wrapping to the next line if this one was hard-wrapped (e.g. not forced by us to wrap)
const auto& row = GetRowByOffset(result.y);
if (!row.WasWrapForced())
{
break;
}
}
bufferSize.IncrementInBounds(result);
}
if (_GetDelimiterClassAt(result, wordDelimiters) != initialDelimiter)
{
// move off of delimiter
bufferSize.DecrementInBounds(result);
}
return result;
}
void TextBuffer::_PruneHyperlinks()
{
// Check the old first row for hyperlink references
@@ -1470,6 +1671,57 @@ void TextBuffer::_PruneHyperlinks()
}
}
// Method Description:
// - Update pos to be the position of the first character of the next word. This is used for accessibility
// Arguments:
// - pos - a til::point on the word you are currently on
// - wordDelimiters - what characters are we considering for the separation of words
// - limitOptional - (optional) the last possible position in the buffer that can be explored. This can be used to improve performance.
// Return Value:
// - true, if successfully updated pos. False, if we are unable to move (usually due to a buffer boundary)
// - pos - The til::point for the first character on the "word" (inclusive)
bool TextBuffer::MoveToNextWord(til::point& pos, const std::wstring_view wordDelimiters, std::optional<til::point> limitOptional) const
{
// move to the beginning of the next word
// NOTE: _GetWordEnd...() returns the exclusive position of the "end of the word"
// This is also the inclusive start of the next word.
const auto bufferSize{ GetSize() };
const auto limit{ limitOptional.value_or(bufferSize.EndExclusive()) };
const auto copy{ _GetWordEndForAccessibility(pos, wordDelimiters, limit) };
if (bufferSize.CompareInBounds(copy, limit, true) >= 0)
{
return false;
}
pos = copy;
return true;
}
// Method Description:
// - Update pos to be the position of the first character of the previous word. This is used for accessibility
// Arguments:
// - pos - a til::point on the word you are currently on
// - wordDelimiters - what characters are we considering for the separation of words
// Return Value:
// - true, if successfully updated pos. False, if we are unable to move (usually due to a buffer boundary)
// - pos - The til::point for the first character on the "word" (inclusive)
bool TextBuffer::MoveToPreviousWord(til::point& pos, std::wstring_view wordDelimiters) const
{
// move to the beginning of the current word
auto copy{ GetWordStart(pos, wordDelimiters, true) };
if (!GetSize().DecrementInBounds(copy, true))
{
// can't move behind current word
return false;
}
// move to the beginning of the previous word
pos = GetWordStart(copy, wordDelimiters, true);
return true;
}
// Method Description:
// - Update pos to be the beginning of the current glyph/character. This is used for accessibility
// Arguments:
@@ -3527,34 +3779,3 @@ void TextBuffer::ManuallyMarkRowAsPrompt(til::CoordType y)
attr.SetMarkAttributes(MarkKind::Prompt);
}
}
// This is an optimization used by the renderer to avoid scheduling a timer if not necessary;
// unlike the renderer, we know the committed range of our own buffer.
bool TextBuffer::ContainsBlinkAttributeInRegion(const Microsoft::Console::Types::Viewport& region) const
{
const auto top = region.Top();
auto bottom = std::min(region.BottomInclusive(), _estimateOffsetOfLastCommittedRow());
for (auto row = top; row < bottom; ++row)
{
const auto& r = GetRowByOffset(row);
for (const auto& attr : r.Attributes())
{
if (attr.IsBlinking())
{
return true;
}
}
}
return false;
}
bool TextBuffer::IsGlyphDoubleWidthAt(const til::point at) const
{
if (!_isRowCommitted(at.y)) [[unlikely]]
{
return false;
}
return _getRow(at.y).DbcsAttrAt(at.x) != DbcsAttribute::Single;
}

View File

@@ -172,10 +172,15 @@ public:
void TriggerNewTextNotification(const std::wstring_view newText);
void TriggerSelection();
til::point GetWordStart(til::point pos, const std::wstring_view wordDelimiters, bool includeWhitespace, std::optional<til::point> limitOptional = std::nullopt) const;
til::point GetWordEnd(til::point pos, const std::wstring_view wordDelimiters, bool includeWhitespace, std::optional<til::point> limitOptional = std::nullopt) const;
til::point GetWordStart(const til::point target, const std::wstring_view wordDelimiters, bool accessibilityMode = false, std::optional<til::point> limitOptional = std::nullopt) const;
til::point GetWordEnd(const til::point target, const std::wstring_view wordDelimiters, bool accessibilityMode = false, std::optional<til::point> limitOptional = std::nullopt) const;
til::point GetWordStart2(til::point pos, const std::wstring_view wordDelimiters, bool includeWhitespace, std::optional<til::point> limitOptional = std::nullopt) const;
til::point GetWordEnd2(til::point pos, const std::wstring_view wordDelimiters, bool includeWhitespace, std::optional<til::point> limitOptional = std::nullopt) const;
bool IsWordBoundary(const til::point pos, const std::wstring_view wordDelimiters) const;
bool MoveToNextWord(til::point& pos, const std::wstring_view wordDelimiters, std::optional<til::point> limitOptional = std::nullopt) const;
bool MoveToPreviousWord(til::point& pos, const std::wstring_view wordDelimiters) const;
til::point GetGlyphStart(const til::point pos, std::optional<til::point> limitOptional = std::nullopt) const;
til::point GetGlyphEnd(const til::point pos, bool accessibilityMode = false, std::optional<til::point> limitOptional = std::nullopt) const;
@@ -310,9 +315,6 @@ public:
void SetScrollbarData(ScrollbarData mark, til::CoordType y);
void ManuallyMarkRowAsPrompt(til::CoordType y);
bool ContainsBlinkAttributeInRegion(const Microsoft::Console::Types::Viewport& region) const;
bool IsGlyphDoubleWidthAt(const til::point at) const;
private:
void _reserve(til::size screenBufferSize, const TextAttribute& defaultAttributes);
void _commit(const std::byte* row);
@@ -322,13 +324,16 @@ private:
ROW& _getRowByOffsetDirect(size_t offset);
ROW& _getRow(til::CoordType y) const;
til::CoordType _estimateOffsetOfLastCommittedRow() const noexcept;
bool _isRowCommitted(til::CoordType y) const noexcept;
void _SetFirstRowIndex(const til::CoordType FirstRowIndex) noexcept;
void _ExpandTextRow(til::inclusive_rect& selectionRow) const;
DelimiterClass _GetDelimiterClassAt(const til::point pos, const std::wstring_view wordDelimiters) const;
til::point _GetDelimiterClassRunStart(til::point pos, const std::wstring_view wordDelimiters, const bool accessibilityMode = false) const;
til::point _GetDelimiterClassRunEnd(til::point pos, const std::wstring_view wordDelimiters, const bool accessibilityMode = false) const;
til::point _GetDelimiterClassRunStart(til::point pos, const std::wstring_view wordDelimiters) const;
til::point _GetDelimiterClassRunEnd(til::point pos, const std::wstring_view wordDelimiters) const;
til::point _GetWordStartForAccessibility(const til::point target, const std::wstring_view wordDelimiters) const;
til::point _GetWordStartForSelection(const til::point target, const std::wstring_view wordDelimiters) const;
til::point _GetWordEndForAccessibility(const til::point target, const std::wstring_view wordDelimiters, const til::point limit) const;
til::point _GetWordEndForSelection(const til::point target, const std::wstring_view wordDelimiters) const;
void _PruneHyperlinks();
std::wstring _commandForRow(const til::CoordType rowOffset, const til::CoordType bottomInclusive, const bool clipAtCursor = false) const;

View File

@@ -34,16 +34,6 @@ class UTextAdapterTests
{
TEST_CLASS(UTextAdapterTests);
TEST_CLASS_SETUP(ClassSetup)
{
wil::unique_hmodule icu{ LoadLibraryExW(L"icu.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32) };
if (!icu)
{
WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, L"ICU is not present");
}
return true;
}
TEST_METHOD(Unicode)
{
DummyRenderer renderer;

View File

@@ -26,9 +26,6 @@ TARGETLIBS = \
$(CONSOLE_OBJ_PATH)\types\lib\$(O)\ConTypes.lib \
$(TARGETLIBS) \
DELAYLOAD = \
icu.dll \
# -------------------------------------
# Localization
# -------------------------------------

View File

@@ -1421,7 +1421,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"profile0", terminalArgs.Profile());
VERIFY_IS_NULL(terminalArgs.Elevate());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, settings.WindowSettingsDefaults());
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
@@ -1444,7 +1444,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"profile1", terminalArgs.Profile());
VERIFY_IS_NULL(terminalArgs.Elevate());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, settings.WindowSettingsDefaults());
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
@@ -1467,7 +1467,7 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"profile2", terminalArgs.Profile());
VERIFY_IS_NULL(terminalArgs.Elevate());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, settings.WindowSettingsDefaults());
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
@@ -1492,7 +1492,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, settings.WindowSettingsDefaults());
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
@@ -1516,7 +1516,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, settings.WindowSettingsDefaults());
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
@@ -1540,7 +1540,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, settings.WindowSettingsDefaults());
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
@@ -1565,7 +1565,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, settings.WindowSettingsDefaults());
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
@@ -1588,7 +1588,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, settings.WindowSettingsDefaults());
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
@@ -1612,7 +1612,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, settings.WindowSettingsDefaults());
const auto termSettings = termSettingsResult.DefaultSettings();
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings->Commandline());
VERIFY_ARE_EQUAL(true, termSettings->Elevate());

View File

@@ -1099,7 +1099,7 @@ namespace TerminalAppLocalTests
Log::Comment(L"Change the tab switch order to MRU switching");
TestOnUIThread([&page]() {
page->_settings.GlobalSettings().TabSwitcherMode(TabSwitcherMode::MostRecentlyUsed);
page->_currentWindowSettings().TabSwitcherMode(TabSwitcherMode::MostRecentlyUsed);
});
Log::Comment(L"Switch to the next MRU tab, which is the fourth tab");
@@ -1145,7 +1145,7 @@ namespace TerminalAppLocalTests
});
Log::Comment(L"Change the tab switch order to in-order switching");
page->_settings.GlobalSettings().TabSwitcherMode(TabSwitcherMode::InOrder);
page->_currentWindowSettings().TabSwitcherMode(TabSwitcherMode::InOrder);
Log::Comment(L"Switch to the next in-order tab, which is the third tab");
TestOnUIThread([&page]() {
@@ -1157,7 +1157,7 @@ namespace TerminalAppLocalTests
});
Log::Comment(L"Change the tab switch order to not use the tab switcher (which is in-order always)");
page->_settings.GlobalSettings().TabSwitcherMode(TabSwitcherMode::Disabled);
page->_currentWindowSettings().TabSwitcherMode(TabSwitcherMode::Disabled);
Log::Comment(L"Switch to the next in-order tab, which is the fourth tab");
TestOnUIThread([&page]() {
@@ -1219,7 +1219,7 @@ namespace TerminalAppLocalTests
Log::Comment(L"Change the tab switch order to MRU switching");
TestOnUIThread([&page]() {
page->_settings.GlobalSettings().TabSwitcherMode(TabSwitcherMode::MostRecentlyUsed);
page->_currentWindowSettings().TabSwitcherMode(TabSwitcherMode::MostRecentlyUsed);
});
Log::Comment(L"Select the tabs from 0 to 3");

View File

@@ -192,7 +192,7 @@
ResourceKey="TabViewBackground" />
<SolidColorBrush x:Key="SettingsUiTabBrush"
Color="#282828" />
Color="#0c0c0c" />
<SolidColorBrush x:Key="BroadcastPaneBorderColor"
Color="{StaticResource SystemAccentColorDark2}" />
@@ -211,7 +211,7 @@
ResourceKey="TabViewBackground" />
<SolidColorBrush x:Key="SettingsUiTabBrush"
Color="#F9F9F9" />
Color="#ffffff" />
<SolidColorBrush x:Key="BroadcastPaneBorderColor"
Color="{StaticResource SystemAccentColorLight2}" />
@@ -234,7 +234,7 @@
ResourceKey="SystemColorButtonFaceColorBrush" />
<StaticResource x:Key="SettingsUiTabBrush"
ResourceKey="SystemColorWindowBrush" />
ResourceKey="SystemControlBackgroundBaseLowBrush" />
<SolidColorBrush x:Key="BroadcastPaneBorderColor"
Color="{StaticResource SystemColorHighlightColor}" />

View File

@@ -550,7 +550,7 @@ namespace winrt::TerminalApp::implementation
if (const auto& realArgs = args.ActionArgs().try_as<CopyTextArgs>())
{
const auto copyFormatting = realArgs.CopyFormatting();
const auto format = copyFormatting ? copyFormatting.Value() : _settings.GlobalSettings().CopyFormatting();
const auto format = copyFormatting ? copyFormatting.Value() : _currentWindowSettings().CopyFormatting();
const auto handled = _CopyText(realArgs.DismissSelection(), realArgs.SingleLine(), realArgs.WithControlSequences(), format);
args.Handled(handled);
}
@@ -801,7 +801,7 @@ namespace winrt::TerminalApp::implementation
_RemoveTabs(tabsToRemove);
actionArgs.Handled(!tabsToRemove.empty());
actionArgs.Handled(true);
}
}
@@ -837,7 +837,7 @@ namespace winrt::TerminalApp::implementation
// tab row, until you mouse over them. Probably has something to do
// with tabs not resizing down until there's a mouse exit event.
actionArgs.Handled(!tabsToRemove.empty());
actionArgs.Handled(true);
}
}
@@ -938,6 +938,27 @@ namespace winrt::TerminalApp::implementation
co_return;
}
// Launch `wt -w <name>` so the monarch can either summon an existing
// window with that name or restore a persisted workspace.
safe_void_coroutine TerminalPage::_OpenWorkspaceWindow(const winrt::hstring name)
{
co_await winrt::resume_background();
const auto exePath{ GetWtExePath() };
const auto cmdline = fmt::format(FMT_COMPILE(L"-w {}"), std::wstring_view{ name });
SHELLEXECUTEINFOW seInfo{ 0 };
seInfo.cbSize = sizeof(seInfo);
seInfo.fMask = SEE_MASK_NOASYNC;
seInfo.lpVerb = L"open";
seInfo.lpFile = exePath.c_str();
seInfo.lpParameters = cmdline.c_str();
seInfo.nShow = SW_SHOWNORMAL;
LOG_IF_WIN32_BOOL_FALSE(ShellExecuteExW(&seInfo));
co_return;
}
void TerminalPage::_HandleNewWindow(const IInspectable& /*sender*/,
const ActionEventArgs& actionArgs)
{
@@ -961,7 +982,7 @@ namespace winrt::TerminalApp::implementation
if (const auto& terminalArgs{ newContentArgs.try_as<NewTerminalArgs>() })
{
const auto profile{ _settings.GetProfileForArgs(terminalArgs) };
const auto profile{ _settings.GetProfileForArgs(terminalArgs, _currentWindowSettings()) };
terminalArgs.Profile(::Microsoft::Console::Utils::GuidToString(profile.Guid()));
}
@@ -1118,7 +1139,7 @@ namespace winrt::TerminalApp::implementation
// use global default if query URL is unspecified
if (queryUrl.empty())
{
queryUrl = std::wstring_view{ _settings.GlobalSettings().SearchWebDefaultQueryUrl() };
queryUrl = std::wstring_view{ _currentWindowSettings().SearchWebDefaultQueryUrl() };
}
constexpr std::wstring_view queryToken{ L"%s" };
@@ -1475,7 +1496,7 @@ namespace winrt::TerminalApp::implementation
WI_IsAnyFlagSet(source, SuggestionsSource::CommandHistory | SuggestionsSource::QuickFixes);
if (const auto& control{ _GetActiveControl() })
{
currentWorkingDirectory = control.WorkingDirectory();
currentWorkingDirectory = control.CurrentWorkingDirectory();
if (shouldGetContext)
{
@@ -1633,4 +1654,68 @@ namespace winrt::TerminalApp::implementation
args.Handled(handled);
}
}
void TerminalPage::_HandleOpenWorkspace(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
// Open (or summon) a named window. We launch a new `wt -w <name>`
// process which the monarch will route to the correct live window or
// restore from a persisted workspace.
if (args)
{
if (const auto& realArgs = args.ActionArgs().try_as<OpenWorkspaceArgs>())
{
const auto name = realArgs.Name();
if (!name.empty())
{
_OpenWorkspaceWindow(name);
}
args.Handled(true);
}
}
}
void TerminalPage::_HandleSaveWorkspace(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
if (args)
{
if (const auto& realArgs = args.ActionArgs().try_as<SaveWorkspaceArgs>())
{
// If a name is supplied, use it; otherwise fall back to the
// current window name.
auto name = realArgs.Name();
if (name.empty())
{
name = _WindowProperties.WindowName();
}
if (!name.empty())
{
if (const auto layout = GetWindowLayout())
{
ApplicationState::SharedInstance().SaveWorkspace(name, layout);
}
}
args.Handled(true);
}
}
}
void TerminalPage::_HandleDeleteWorkspace(const IInspectable& /*sender*/,
const ActionEventArgs& args)
{
if (args)
{
if (const auto& realArgs = args.ActionArgs().try_as<DeleteWorkspaceArgs>())
{
const auto name = realArgs.Name();
if (!name.empty())
{
ApplicationState::SharedInstance().RemoveWorkspace(name);
}
args.Handled(true);
}
}
}
}

View File

@@ -1068,15 +1068,6 @@ int AppCommandlineArgs::ParseArgs(winrt::array_view<const winrt::hstring> args)
return 0;
}
// When a toast notification is clicked, Windows may launch a new instance
// with "__fromToast" as the argument. This is a no-op sentinel — the
// in-process Activated handler on the toast already handled activation.
// See DesktopNotification.cpp for more details.
if (args.size() == 2 && args[1] == L"__fromToast")
{
return 0;
}
auto commands = ::TerminalApp::AppCommandlineArgs::BuildCommands(args);
for (auto& cmdBlob : commands)

View File

@@ -194,7 +194,7 @@ namespace winrt::TerminalApp::implementation
g_hTerminalAppProvider,
"AppCreated",
TraceLoggingDescription("Event emitted when the application is started"),
TraceLoggingBool(_settings.GlobalSettings().ShowTabsInTitlebar(), "TabsInTitlebar"),
TraceLoggingBool(_settings.WindowSettingsDefaults().ShowTabsInTitlebar(), "TabsInTitlebar"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
}
@@ -229,12 +229,12 @@ namespace winrt::TerminalApp::implementation
}
_hasSettingsStartupActions = false;
const auto startupActions = newSettings.GlobalSettings().StartupActions();
const auto startupActions = newSettings.WindowSettingsDefaults().StartupActions();
if (!startupActions.empty())
{
_settingsAppArgs.FullResetState();
ExecuteCommandlineArgs args{ newSettings.GlobalSettings().StartupActions() };
ExecuteCommandlineArgs args{ newSettings.WindowSettingsDefaults().StartupActions() };
auto result = _settingsAppArgs.ParseArgs(args);
if (result == 0)
{

View File

@@ -15,7 +15,6 @@ namespace winrt::TerminalApp::implementation
til::typed_event<IPaneContent> TaskbarProgressChanged;
til::typed_event<IPaneContent> ReadOnlyChanged;
til::typed_event<IPaneContent> FocusRequested;
til::typed_event<IPaneContent, winrt::TerminalApp::NotificationEventArgs> NotificationRequested;
til::typed_event<winrt::Windows::Foundation::IInspectable, Microsoft::Terminal::Settings::Model::Command> DispatchCommandRequested;
};

View File

@@ -1,129 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "DesktopNotification.h"
#include <WtExeUtils.h>
using namespace winrt::Windows::UI::Notifications;
using namespace winrt::Windows::Data::Xml::Dom;
namespace winrt::TerminalApp::implementation
{
std::atomic<int64_t> DesktopNotification::_lastNotificationTime{ 0 };
// Method Description:
// - Rate-limits toast notifications so we don't spam the user.
// Return Value:
// - Returns true if a notification is allowed, false if too recent.
bool DesktopNotification::ShouldSendNotification()
{
FILETIME ft{};
GetSystemTimeAsFileTime(&ft);
const auto now = (static_cast<int64_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
auto last = _lastNotificationTime.load(std::memory_order_relaxed);
if (now - last < MinNotificationIntervalTicks)
{
return false;
}
// Attempt to update; if another thread beat us, that's fine — we'll skip this one.
return _lastNotificationTime.compare_exchange_strong(last, now, std::memory_order_relaxed);
}
// Method Description:
// - Sends a toast notification with the given title and message.
// - When the user clicks the toast, the `Activated` callback fires
// with the tabIndex that was passed in, so the caller can switch
// to the correct tab and summon the window.
// Arguments:
// - args: The title, message, and tab index to include in the notification.
// - activated: A callback invoked on the background thread when the
// toast is clicked. The uint32_t parameter is the tab index.
void DesktopNotification::SendNotification(const DesktopNotificationArgs& args, std::function<void()> activatedFunc)
{
try
{
if (!ShouldSendNotification())
{
return;
}
// Build the toast XML. We use a simple template with a title and body text.
//
// <toast launch="__fromToast">
// <visual>
// <binding template="ToastGeneric">
// <text>Title</text>
// <text>Message</text>
// </binding>
// </visual>
// </toast>
auto toastXml = ToastNotificationManager::GetTemplateContent(ToastTemplateType::ToastText02);
auto textNodes = toastXml.GetElementsByTagName(L"text");
// First <text> is the title
textNodes.Item(0).InnerText(args.Title);
// Second <text> is the body
textNodes.Item(1).InnerText(args.Message);
auto toastElement = toastXml.DocumentElement();
// When a toast is clicked, Windows launches a new instance of the app
// with the "launch" attribute as command-line arguments. We handle
// toast activation in-process via the Activated event below, so the
// new instance should do nothing. "__fromToast" is recognized by
// AppCommandlineArgs::ParseArgs as a no-op sentinel.
toastElement.SetAttribute(L"launch", L"__fromToast");
toastElement.SetAttribute(L"scenario", L"default");
auto toast = ToastNotification{ toastXml };
// Set the tag and group to enable notification replacement.
// Repeated notifications with the same tag replace the previous one
// rather than stacking in the notification center.
toast.Tag(args.Tag);
toast.Group(L"WindowsTerminal");
// When the user activates (clicks) the toast, fire the callback.
if (activatedFunc)
{
toast.Activated([activatedFunc](const auto& /*sender*/, const auto& /*eventArgs*/) {
activatedFunc();
});
}
// For packaged apps, CreateToastNotifier() uses the package identity automatically.
// For unpackaged apps, we must pass the explicit AUMID that was registered
// at startup via SetCurrentProcessExplicitAppUserModelID.
winrt::Windows::UI::Notifications::ToastNotifier notifier{ nullptr };
if (IsPackaged())
{
notifier = ToastNotificationManager::CreateToastNotifier();
}
else
{
// Retrieve the AUMID that was set by WindowEmperor at startup.
wil::unique_cotaskmem_string aumid;
if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(&aumid)))
{
notifier = ToastNotificationManager::CreateToastNotifier(aumid.get());
}
}
if (notifier)
{
notifier.Show(toast);
}
}
catch (...)
{
// Toast notification is a best-effort feature. If it fails (e.g., notifications
// are disabled, or the app is unpackaged without proper AUMID setup), we silently
// ignore the error.
LOG_CAUGHT_EXCEPTION();
}
}
}

View File

@@ -1,38 +0,0 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- DesktopNotification.h
Module Description:
- Helper for sending Windows desktop toast notifications. Used to surface
terminal activity events to the user via the Windows notification center.
--*/
#pragma once
#include "pch.h"
namespace winrt::TerminalApp::implementation
{
struct DesktopNotificationArgs
{
winrt::hstring Title;
winrt::hstring Message;
winrt::hstring Tag;
};
class DesktopNotification
{
public:
static bool ShouldSendNotification();
static void SendNotification(const DesktopNotificationArgs& args, std::function<void()> activatedFunc);
private:
static std::atomic<int64_t> _lastNotificationTime;
// Minimum interval between notifications, in 100ns ticks (FILETIME units).
// 5 seconds = 5 * 10,000,000
static constexpr int64_t MinNotificationIntervalTicks = 50'000'000LL;
};
}

View File

@@ -14,15 +14,6 @@ namespace TerminalApp
runtimeclass BellEventArgs
{
Boolean FlashTaskbar { get; };
Boolean SendNotification { get; };
};
runtimeclass NotificationEventArgs
{
Microsoft.Terminal.Control.OutputNotificationStyle Style { get; };
Boolean OnlyWhenInactive { get; };
String Title { get; };
String Body { get; };
};
interface IPaneContent
@@ -55,7 +46,6 @@ namespace TerminalApp
event Windows.Foundation.TypedEventHandler<IPaneContent, Object> TaskbarProgressChanged;
event Windows.Foundation.TypedEventHandler<IPaneContent, Object> ReadOnlyChanged;
event Windows.Foundation.TypedEventHandler<IPaneContent, Object> FocusRequested;
event Windows.Foundation.TypedEventHandler<IPaneContent, NotificationEventArgs> NotificationRequested;
};

View File

@@ -31,14 +31,10 @@ Pane::Pane(IPaneContent content, const bool lastFocused) :
_lastActive{ lastFocused }
{
_setPaneContent(std::move(content));
_CreatePaneHeader();
_root.Children().Append(_borderFirst);
const auto& control{ _content.GetRoot() };
// Set up leaf layout: header in _root row 0, content in _borderFirst row 1.
// The TermControl stays as the direct child of _borderFirst (no Grid wrapper)
// so the SwapChainPanel renders correctly.
_SetupLeafLayout(control);
_borderFirst.Child(control);
// Register an event with the control to have it inform us when it gains focus.
if (control)
@@ -1232,12 +1228,6 @@ void Pane::UpdateVisuals()
const auto& brush{ _ComputeBorderColor() };
_borderFirst.BorderBrush(brush);
_borderSecond.BorderBrush(brush);
// Update pane header color to match focus state
if (_paneHeaderBorder && _paneHeaderBorder.Visibility() == winrt::Windows::UI::Xaml::Visibility::Visible)
{
_paneHeaderBorder.Background(brush);
}
}
// Method Description:
@@ -1460,9 +1450,9 @@ void Pane::_CloseChild(const bool closeFirst)
_root.RowDefinitions().Clear();
// Reattach the TermControl to our grid.
_CreatePaneHeader();
_root.Children().Append(_borderFirst);
const auto& control{ _content.GetRoot() };
_SetupLeafLayout(control);
_borderFirst.Child(control);
// Make sure to set our _splitState before focusing the control. If you
// fail to do this, when the tab handles the GotFocus event and asks us
@@ -1765,92 +1755,7 @@ void Pane::_setPaneContent(IPaneContent content)
}
// Method Description:
// - Creates the pane header UI elements (title bar shown above the content).
// The header is initially collapsed and only shown via ShowPaneHeaders().
void Pane::_CreatePaneHeader()
{
namespace WUX = winrt::Windows::UI::Xaml;
_paneHeaderText = Controls::TextBlock{};
_paneHeaderText.FontSize(12);
_paneHeaderText.Padding({ 8, 2, 8, 2 });
_paneHeaderText.IsTextSelectionEnabled(false);
_paneHeaderText.TextTrimming(WUX::TextTrimming::CharacterEllipsis);
if (_content)
{
_paneHeaderText.Text(_content.Title());
_titleChangedRevoker = _content.TitleChanged(winrt::auto_revoke, [this](auto&&, auto&&) {
_paneHeaderBorder.Dispatcher().RunAsync(
winrt::Windows::UI::Core::CoreDispatcherPriority::Normal,
[this]() {
if (_content && _paneHeaderText)
{
_paneHeaderText.Text(_content.Title());
}
});
});
}
_paneHeaderBorder = Controls::Border{};
_paneHeaderBorder.Padding({ 0, 0, 0, 0 });
_paneHeaderBorder.Child(_paneHeaderText);
_paneHeaderBorder.Visibility(WUX::Visibility::Collapsed);
}
// Method Description:
// - Sets up the leaf pane layout in _root: a header row (auto-sized) and a
// content row (star-sized). The TermControl stays as the direct child of
// _borderFirst so the SwapChainPanel renders correctly.
void Pane::_SetupLeafLayout(const winrt::Windows::UI::Xaml::UIElement& control)
{
auto headerRow = Controls::RowDefinition{};
headerRow.Height(GridLengthHelper::Auto());
auto contentRow = Controls::RowDefinition{};
contentRow.Height(GridLengthHelper::FromValueAndType(1, GridUnitType::Star));
_root.RowDefinitions().Append(headerRow);
_root.RowDefinitions().Append(contentRow);
Controls::Grid::SetRow(_paneHeaderBorder, 0);
Controls::Grid::SetRow(_borderFirst, 1);
_root.Children().Append(_paneHeaderBorder);
_root.Children().Append(_borderFirst);
if (control)
{
_borderFirst.Child(control);
}
}
// Method Description:
// - Show or hide the pane header title bar on all leaf panes in the tree.
// Called by Tab when the number of panes changes.
void Pane::ShowPaneHeaders(bool show)
{
if (_IsLeaf())
{
if (_paneHeaderBorder)
{
namespace WUX = winrt::Windows::UI::Xaml;
_paneHeaderBorder.Visibility(show ? WUX::Visibility::Visible : WUX::Visibility::Collapsed);
if (show)
{
const auto& brush = _ComputeBorderColor();
_paneHeaderBorder.Background(brush);
_paneHeaderText.Foreground(winrt::Windows::UI::Xaml::Media::SolidColorBrush(winrt::Windows::UI::Colors::White()));
}
}
}
else
{
_firstChild->ShowPaneHeaders(show);
_secondChild->ShowPaneHeaders(show);
}
}
// Method Description:
// - Sets up row/column definitions for this pane.There are three total
// - Sets up row/column definitions for this pane. There are three total
// row/cols. The middle one is for the separator. The first and third are for
// each of the child panes, and are given a size in pixels, based off the
// available space, and the percent of the space they respectively consume,
@@ -2416,10 +2321,6 @@ std::pair<std::shared_ptr<Pane>, std::shared_ptr<Pane>> Pane::_Split(SplitDirect
_root.RowDefinitions().Clear();
_CreateRowColDefinitions();
// Reset Grid.Row on _borderFirst — it may have been set to row 1 in the
// leaf layout (header=row0, content=row1).
Controls::Grid::SetRow(_borderFirst, 0);
_borderFirst.Child(_firstChild->GetRootElement());
_borderSecond.Child(_secondChild->GetRootElement());

View File

@@ -150,7 +150,6 @@ public:
bool ContainsReadOnly() const;
void EnableBroadcast(bool enabled);
void ShowPaneHeaders(bool show);
void BroadcastKey(const winrt::Microsoft::Terminal::Control::TermControl& sourceControl, const WORD vkey, const WORD scanCode, const winrt::Microsoft::Terminal::Core::ControlKeyStates modifiers, const bool keyDown);
void BroadcastChar(const winrt::Microsoft::Terminal::Control::TermControl& sourceControl, const wchar_t vkey, const WORD scanCode, const winrt::Microsoft::Terminal::Core::ControlKeyStates modifiers);
void BroadcastString(const winrt::Microsoft::Terminal::Control::TermControl& sourceControl, const winrt::hstring& text);
@@ -236,11 +235,6 @@ private:
winrt::Windows::UI::Xaml::Controls::Border _borderFirst{};
winrt::Windows::UI::Xaml::Controls::Border _borderSecond{};
// Per-pane title header (visible when there are split panes)
winrt::Windows::UI::Xaml::Controls::Border _paneHeaderBorder{ nullptr };
winrt::Windows::UI::Xaml::Controls::TextBlock _paneHeaderText{ nullptr };
winrt::TerminalApp::IPaneContent::TitleChanged_revoker _titleChangedRevoker;
PaneResources _themeResources;
#pragma region Properties that need to be transferred between child / parent panes upon splitting / closing
@@ -272,8 +266,6 @@ private:
void _SetupChildCloseHandlers();
winrt::TerminalApp::IPaneContent _takePaneContent();
void _setPaneContent(winrt::TerminalApp::IPaneContent content);
void _CreatePaneHeader();
void _SetupLeafLayout(const winrt::Windows::UI::Xaml::UIElement& control);
bool _HasChild(const std::shared_ptr<Pane> child);
winrt::TerminalApp::TerminalPaneContent _getTerminalContent() const;

View File

@@ -85,6 +85,7 @@ namespace winrt::TerminalApp::implementation
WINRT_PROPERTY(TerminalApp::CommandlineArgs, Command, nullptr);
WINRT_PROPERTY(winrt::hstring, Content);
WINRT_PROPERTY(Windows::Foundation::IReference<Windows::Foundation::Rect>, InitialBounds);
WINRT_PROPERTY(winrt::Microsoft::Terminal::Settings::Model::WindowLayout, PersistedLayout, nullptr);
};
}

View File

@@ -51,5 +51,6 @@ namespace TerminalApp
CommandlineArgs Command { get; };
String Content { get; };
Windows.Foundation.IReference<Windows.Foundation.Rect> InitialBounds { get; };
Microsoft.Terminal.Settings.Model.WindowLayout PersistedLayout;
};
}

View File

@@ -496,48 +496,24 @@
<value>Third-Party notices</value>
<comment>A hyperlink name for the Terminal's third-party notices</comment>
</data>
<data name="ConfirmCloseDialog_Cancel" xml:space="preserve">
<data name="QuitDialog.CloseButtonText" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="ConfirmCloseDialog_CloseAllTitle" xml:space="preserve">
<data name="QuitDialog.PrimaryButtonText" xml:space="preserve">
<value>Close all</value>
</data>
<data name="QuitDialog.Title" xml:space="preserve">
<value>Do you want to close all windows?</value>
</data>
<data name="ConfirmCloseDialog_CloseAllPrimary" xml:space="preserve">
<data name="CloseAllDialog.CloseButtonText" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="CloseAllDialog.PrimaryButtonText" xml:space="preserve">
<value>Close all</value>
</data>
<data name="ConfirmCloseDialog_WindowTitle" xml:space="preserve">
<data name="CloseAllDialog.Title" xml:space="preserve">
<value>Do you want to close all tabs?</value>
</data>
<data name="ConfirmCloseDialog_WindowPrimary" xml:space="preserve">
<value>Close all</value>
</data>
<data name="ConfirmCloseDialog_TabTitle" xml:space="preserve">
<value>Do you want to close this tab?</value>
</data>
<data name="ConfirmCloseDialog_TabPrimary" xml:space="preserve">
<value>Close tab</value>
</data>
<data name="ConfirmCloseDialog_PaneTitle" xml:space="preserve">
<value>Do you want to close this pane?</value>
</data>
<data name="ConfirmCloseDialog_PanePrimary" xml:space="preserve">
<value>Close pane</value>
</data>
<data name="ConfirmCloseDialog_MultipleTabsTitle" xml:space="preserve">
<value>Do you want to close these tabs?</value>
</data>
<data name="ConfirmCloseDialog_MultipleTabsPrimary" xml:space="preserve">
<value>Close tabs</value>
</data>
<data name="ConfirmCloseDialog_MultiplePanesTitle" xml:space="preserve">
<value>Do you want to close these panes?</value>
</data>
<data name="ConfirmCloseDialog_MultiplePanesPrimary" xml:space="preserve">
<value>Close panes</value>
</data>
<data name="DontAskAgainCheckBox.Content" xml:space="preserve">
<value>Don't ask me again</value>
</data>
<data name="CloseReadOnlyDialog.CloseButtonText" xml:space="preserve">
<value>Cancel</value>
</data>
@@ -693,15 +669,9 @@
<data name="UnsupportedSchemeText" xml:space="preserve">
<value>This link type is currently not supported:</value>
</data>
<data name="UriErrorDialog.CloseButtonText" xml:space="preserve">
<data name="CouldNotOpenUriDialog.PrimaryButtonText" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="UnsafeUrlConfirmText" xml:space="preserve">
<value>This link may lead to an unsafe location. Hyperlinks can be harmful to your computer and data. To protect your computer, only click links from trusted sources.</value>
</data>
<data name="UnsafeUrlConfirmAllowAction" xml:space="preserve">
<value>Open anyway</value>
</data>
<data name="SettingsTab" xml:space="preserve">
<value>Settings</value>
</data>
@@ -769,14 +739,6 @@
<value>Windows</value>
<comment>This is displayed as a label for the context menu item that holds the submenu of available windows.</comment>
</data>
<data name="NotificationMessage_TabActivity" xml:space="preserve">
<value>Activity in tab "{0}"</value>
<comment>{0} is the tab title. Shown as the body of a desktop notification when tab activity is detected.</comment>
</data>
<data name="NotificationMessage_TabActivityInWindow" xml:space="preserve">
<value>Activity in tab "{0}" (window "{1}")</value>
<comment>{0} is the tab title, {1} is the window name. Shown as the body of a desktop notification when tab activity is detected and the window has a name.</comment>
</data>
<data name="DropPathTabRun.Text" xml:space="preserve">
<value>Open a new tab in given starting directory</value>
</data>
@@ -913,10 +875,10 @@
<value>If set, the command will be appended to the profile's default command instead of replacing it.</value>
</data>
<data name="RestartConnectionText" xml:space="preserve">
<value>Restart session</value>
<value>Restart connection</value>
</data>
<data name="RestartConnectionToolTip" xml:space="preserve">
<value>Restart the active pane session</value>
<value>Restart the active pane connection</value>
</data>
<data name="SnippetPaneTitle.Text" xml:space="preserve">
<value>Snippets</value>

View File

@@ -19,7 +19,7 @@ namespace winrt::TerminalApp::implementation
// Stash away the current requested theme of the app. We'll need that in
// _BackgroundBrush() to do a theme-aware resource lookup
_requestedTheme = settings.GlobalSettings().CurrentTheme().RequestedTheme();
_requestedTheme = settings.GlobalSettings().CurrentTheme(settings.WindowSettingsDefaults()).RequestedTheme();
}
void SettingsPaneContent::UpdateSettings(const CascadiaSettings& settings)
@@ -27,7 +27,7 @@ namespace winrt::TerminalApp::implementation
ASSERT_UI_THREAD();
_sui.UpdateSettings(settings);
_requestedTheme = settings.GlobalSettings().CurrentTheme().RequestedTheme();
_requestedTheme = settings.GlobalSettings().CurrentTheme(settings.WindowSettingsDefaults()).RequestedTheme();
}
winrt::Windows::UI::Xaml::FrameworkElement SettingsPaneContent::GetRoot()

View File

@@ -121,7 +121,7 @@ namespace winrt::TerminalApp::implementation
{
static const auto key = winrt::box_value(L"SettingsUiTabBrush");
return ThemeLookup(WUX::Application::Current().Resources(),
_settings.GlobalSettings().CurrentTheme().RequestedTheme(),
_settings.GlobalSettings().CurrentTheme(_settings.WindowSettingsDefaults()).RequestedTheme(),
key)
.try_as<winrt::WUX::Media::Brush>();
}

View File

@@ -35,6 +35,7 @@ namespace winrt::TerminalApp::implementation
_activePane = nullptr;
_closePaneMenuItem.Visibility(WUX::Visibility::Collapsed);
_restartConnectionMenuItem.Visibility(WUX::Visibility::Collapsed);
auto firstId = _nextPaneId;
@@ -85,7 +86,6 @@ namespace winrt::TerminalApp::implementation
_MakeTabViewItem();
_CreateContextMenu();
_UpdateMenuItemStates();
_headerControl.TabStatus(_tabStatus);
@@ -123,12 +123,6 @@ namespace winrt::TerminalApp::implementation
_bellIndicatorTimer.Stop();
}
void Tab::_ActivityIndicatorTimerTick(const Windows::Foundation::IInspectable& /*sender*/, const Windows::Foundation::IInspectable& /*e*/)
{
ShowActivityIndicator(false);
_activityIndicatorTimer.Stop();
}
// Method Description:
// - Initializes a TabViewItem for this Tab instance.
// Arguments:
@@ -179,7 +173,7 @@ namespace winrt::TerminalApp::implementation
// Make sure to try/catch this, because the LocalTests won't be
// able to use this helper.
const auto settings{ winrt::TerminalApp::implementation::AppLogic::CurrentAppSettings() };
if (settings.GlobalSettings().TabWidthMode() == winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode::SizeToContent)
if (settings.WindowSettingsDefaults().TabWidthMode() == winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode::SizeToContent)
{
_headerControl.RenamerMaxWidth(HeaderRenameBoxWidthTitleLength);
}
@@ -335,10 +329,6 @@ namespace winrt::TerminalApp::implementation
{
ShowBellIndicator(false);
}
if (_tabStatus.ActivityIndicator())
{
ShowActivityIndicator(false);
}
}
}
@@ -371,10 +361,6 @@ namespace winrt::TerminalApp::implementation
// The tabWidthMode may have changed, update the header control accordingly
_UpdateHeaderControlMaxWidth();
// Refresh pane header visibility based on the current setting
const auto showHeaders = settings.GlobalSettings().ShowPaneHeaders() && _rootPane->GetLeafPaneCount() > 1;
_rootPane->ShowPaneHeaders(showHeaders);
// Update the settings on all our panes.
_rootPane->WalkTree([&](const auto& pane) {
pane->UpdateSettings(settings);
@@ -473,26 +459,6 @@ namespace winrt::TerminalApp::implementation
_bellIndicatorTimer.Start();
}
void Tab::ShowActivityIndicator(const bool show)
{
ASSERT_UI_THREAD();
_tabStatus.ActivityIndicator(show);
}
void Tab::ActivateActivityIndicatorTimer()
{
ASSERT_UI_THREAD();
if (!_activityIndicatorTimer)
{
_activityIndicatorTimer.Interval(std::chrono::milliseconds(2000));
_activityIndicatorTimer.Tick({ get_weak(), &Tab::_ActivityIndicatorTimerTick });
}
_activityIndicatorTimer.Start();
}
// Method Description:
// - Gets the title string of the last focused terminal control in our tree.
// Returns the empty string if there is no such control.
@@ -680,14 +646,6 @@ namespace winrt::TerminalApp::implementation
// After split, Close Pane Menu Item should be visible
_closePaneMenuItem.Visibility(WUX::Visibility::Visible);
// Show pane headers now that we have multiple panes (if the setting is enabled)
try
{
const auto settings{ winrt::TerminalApp::implementation::AppLogic::CurrentAppSettings() };
_rootPane->ShowPaneHeaders(settings.GlobalSettings().ShowPaneHeaders());
}
CATCH_LOG();
// The active pane has an id if it is a leaf
if (activePaneId)
{
@@ -1110,7 +1068,6 @@ namespace winrt::TerminalApp::implementation
dispatcher,
til::throttled_func_options{
.delay = std::chrono::milliseconds{ 200 },
.leading = true,
.trailing = true,
},
[weakThis]() {
@@ -1191,14 +1148,6 @@ namespace winrt::TerminalApp::implementation
tab->TabRaiseVisualBell.raise();
}
// Send a desktop toast notification if requested, but only if
// the pane isn't already in the belled state. This prevents
// sending repeated toasts for repeated BEL characters.
if (bellArgs.SendNotification() && !tab->_tabStatus.BellIndicator())
{
tab->TabToastNotificationRequested.raise(tab->Title(), L"");
}
// Show the bell indicator in the tab header
tab->ShowBellIndicator(true);
@@ -1217,55 +1166,6 @@ namespace winrt::TerminalApp::implementation
events.RestartTerminalRequested = terminal.RestartTerminalRequested(winrt::auto_revoke, { get_weak(), &Tab::_bubbleRestartTerminalRequested });
}
events.NotificationRequested = content.NotificationRequested(
winrt::auto_revoke,
[dispatcher, weakThis](TerminalApp::IPaneContent sender, auto notifArgs) -> safe_void_coroutine {
const auto weakThisCopy = weakThis;
co_await wil::resume_foreground(dispatcher);
if (const auto tab{ weakThisCopy.get() })
{
const auto activeContent = tab->GetActiveContent();
const auto isActivePaneContent = activeContent && activeContent == sender;
if (notifArgs.OnlyWhenInactive() && isActivePaneContent &&
tab->_focusState != WUX::FocusState::Unfocused)
{
co_return;
}
const auto style = notifArgs.Style();
if (WI_IsFlagSet(style, OutputNotificationStyle::Taskbar))
{
tab->TabRaiseVisualBell.raise();
}
if (WI_IsFlagSet(style, winrt::Microsoft::Terminal::Control::OutputNotificationStyle::Audible))
{
if (const auto termContent{ sender.try_as<TerminalApp::TerminalPaneContent>() })
{
termContent.PlayNotificationSound();
}
}
if (WI_IsFlagSet(style, winrt::Microsoft::Terminal::Control::OutputNotificationStyle::Tab))
{
tab->ShowActivityIndicator(true);
if (tab->_focusState != WUX::FocusState::Unfocused)
{
tab->ActivateActivityIndicatorTimer();
}
}
if (WI_IsFlagSet(style, winrt::Microsoft::Terminal::Control::OutputNotificationStyle::Notification))
{
const auto title = notifArgs.Title().empty() ? tab->Title() : notifArgs.Title();
tab->TabToastNotificationRequested.raise(title, notifArgs.Body());
}
}
});
if (_tabStatus.IsInputBroadcastActive())
{
if (const auto& termContent{ content.try_as<TerminalApp::TerminalPaneContent>() })
@@ -1354,7 +1254,7 @@ namespace winrt::TerminalApp::implementation
// Method Description:
// - Set an indicator on the tab if any pane is in a closed connection state.
// - Show/hide the Restart Session context menu entry depending on active pane's state.
// - Show/hide the Restart Connection context menu entry depending on active pane's state.
// Arguments:
// - <none>
// Return Value:
@@ -1371,6 +1271,13 @@ namespace winrt::TerminalApp::implementation
_tabStatus.IsConnectionClosed(isClosed);
}
if (_activePane)
{
_restartConnectionMenuItem.Visibility(_activePane->IsConnectionClosed() ?
WUX::Visibility::Visible :
WUX::Visibility::Collapsed);
}
}
void Tab::_RestartActivePaneConnection()
@@ -1417,7 +1324,6 @@ namespace winrt::TerminalApp::implementation
if (_rootPane->GetLeafPaneCount() == 1)
{
_closePaneMenuItem.Visibility(WUX::Visibility::Collapsed);
_rootPane->ShowPaneHeaders(false);
}
_RecalculateAndApplyReadOnly();
@@ -1442,22 +1348,6 @@ namespace winrt::TerminalApp::implementation
}
});
}
_UpdateMenuItemStates();
}
void Tab::_UpdateMenuItemStates()
{
// Terminal-specific menu items
const auto content = _activePane ? _activePane->GetContent() : nullptr;
const auto isTerm = content && content.try_as<winrt::TerminalApp::TerminalPaneContent>() != nullptr;
_duplicateTabMenuItem.IsEnabled(isTerm);
_exportTabMenuItem.IsEnabled(isTerm);
_findMenuItem.IsEnabled(isTerm);
_restartConnectionMenuItem.IsEnabled(isTerm);
// Snippets Pane can technically be split
_splitTabMenuItem.IsEnabled(isTerm || (content && content.try_as<winrt::TerminalApp::SnippetsPaneContent>() != nullptr));
}
// Method Description:
@@ -1503,10 +1393,6 @@ namespace winrt::TerminalApp::implementation
{
tab->ShowBellIndicator(false);
}
if (tab->_tabStatus.ActivityIndicator())
{
tab->ShowActivityIndicator(false);
}
}
});
@@ -1766,100 +1652,106 @@ namespace winrt::TerminalApp::implementation
Automation::AutomationProperties::SetHelpText(renameTabMenuItem, renameTabToolTip);
}
Controls::MenuFlyoutItem duplicateTabMenuItem;
{
// "Duplicate tab"
Controls::FontIcon duplicateTabSymbol;
duplicateTabSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
duplicateTabSymbol.Glyph(L"\xF5ED");
_duplicateTabMenuItem.Click({ get_weak(), &Tab::_duplicateTabClicked });
_duplicateTabMenuItem.Text(RS_(L"DuplicateTabText"));
_duplicateTabMenuItem.Icon(duplicateTabSymbol);
duplicateTabMenuItem.Click({ get_weak(), &Tab::_duplicateTabClicked });
duplicateTabMenuItem.Text(RS_(L"DuplicateTabText"));
duplicateTabMenuItem.Icon(duplicateTabSymbol);
const auto duplicateTabToolTip = RS_(L"DuplicateTabToolTip");
WUX::Controls::ToolTipService::SetToolTip(_duplicateTabMenuItem, box_value(duplicateTabToolTip));
Automation::AutomationProperties::SetHelpText(_duplicateTabMenuItem, duplicateTabToolTip);
WUX::Controls::ToolTipService::SetToolTip(duplicateTabMenuItem, box_value(duplicateTabToolTip));
Automation::AutomationProperties::SetHelpText(duplicateTabMenuItem, duplicateTabToolTip);
}
Controls::MenuFlyoutItem splitTabMenuItem;
{
// "Split tab"
Controls::FontIcon splitTabSymbol;
splitTabSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
splitTabSymbol.Glyph(L"\xF246"); // ViewDashboard
_splitTabMenuItem.Click({ get_weak(), &Tab::_splitTabClicked });
_splitTabMenuItem.Text(RS_(L"SplitTabText"));
_splitTabMenuItem.Icon(splitTabSymbol);
splitTabMenuItem.Click({ get_weak(), &Tab::_splitTabClicked });
splitTabMenuItem.Text(RS_(L"SplitTabText"));
splitTabMenuItem.Icon(splitTabSymbol);
const auto splitTabToolTip = RS_(L"SplitTabToolTip");
WUX::Controls::ToolTipService::SetToolTip(_splitTabMenuItem, box_value(splitTabToolTip));
Automation::AutomationProperties::SetHelpText(_splitTabMenuItem, splitTabToolTip);
WUX::Controls::ToolTipService::SetToolTip(splitTabMenuItem, box_value(splitTabToolTip));
Automation::AutomationProperties::SetHelpText(splitTabMenuItem, splitTabToolTip);
}
Controls::MenuFlyoutItem closePaneMenuItem = _closePaneMenuItem;
{
// "Close pane"
_closePaneMenuItem.Click({ get_weak(), &Tab::_closePaneClicked });
_closePaneMenuItem.Text(RS_(L"ClosePaneText"));
closePaneMenuItem.Click({ get_weak(), &Tab::_closePaneClicked });
closePaneMenuItem.Text(RS_(L"ClosePaneText"));
const auto closePaneToolTip = RS_(L"ClosePaneToolTip");
WUX::Controls::ToolTipService::SetToolTip(_closePaneMenuItem, box_value(closePaneToolTip));
Automation::AutomationProperties::SetHelpText(_closePaneMenuItem, closePaneToolTip);
WUX::Controls::ToolTipService::SetToolTip(closePaneMenuItem, box_value(closePaneToolTip));
Automation::AutomationProperties::SetHelpText(closePaneMenuItem, closePaneToolTip);
}
Controls::MenuFlyoutItem exportTabMenuItem;
{
// "Export tab"
Controls::FontIcon exportTabSymbol;
exportTabSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
exportTabSymbol.Glyph(L"\xE74E"); // Save
_exportTabMenuItem.Click({ get_weak(), &Tab::_exportTextClicked });
_exportTabMenuItem.Text(RS_(L"ExportTabText"));
_exportTabMenuItem.Icon(exportTabSymbol);
exportTabMenuItem.Click({ get_weak(), &Tab::_exportTextClicked });
exportTabMenuItem.Text(RS_(L"ExportTabText"));
exportTabMenuItem.Icon(exportTabSymbol);
const auto exportTabToolTip = RS_(L"ExportTabToolTip");
WUX::Controls::ToolTipService::SetToolTip(_exportTabMenuItem, box_value(exportTabToolTip));
Automation::AutomationProperties::SetHelpText(_exportTabMenuItem, exportTabToolTip);
WUX::Controls::ToolTipService::SetToolTip(exportTabMenuItem, box_value(exportTabToolTip));
Automation::AutomationProperties::SetHelpText(exportTabMenuItem, exportTabToolTip);
}
Controls::MenuFlyoutItem findMenuItem;
{
// "Find"
Controls::FontIcon findSymbol;
findSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
findSymbol.Glyph(L"\xF78B"); // SearchMedium
_findMenuItem.Click({ get_weak(), &Tab::_findClicked });
_findMenuItem.Text(RS_(L"FindText"));
_findMenuItem.Icon(findSymbol);
findMenuItem.Click({ get_weak(), &Tab::_findClicked });
findMenuItem.Text(RS_(L"FindText"));
findMenuItem.Icon(findSymbol);
const auto findToolTip = RS_(L"FindToolTip");
WUX::Controls::ToolTipService::SetToolTip(_findMenuItem, box_value(findToolTip));
Automation::AutomationProperties::SetHelpText(_findMenuItem, findToolTip);
WUX::Controls::ToolTipService::SetToolTip(findMenuItem, box_value(findToolTip));
Automation::AutomationProperties::SetHelpText(findMenuItem, findToolTip);
}
Controls::MenuFlyoutItem restartConnectionMenuItem = _restartConnectionMenuItem;
{
// "Restart session"
// "Restart connection"
Controls::FontIcon restartConnectionSymbol;
restartConnectionSymbol.FontFamily(Media::FontFamily{ L"Segoe Fluent Icons, Segoe MDL2 Assets" });
restartConnectionSymbol.Glyph(L"\xE72C");
_restartConnectionMenuItem.Click([weakThis](auto&&, auto&&) {
restartConnectionMenuItem.Click([weakThis](auto&&, auto&&) {
if (auto tab{ weakThis.get() })
{
tab->_RestartActivePaneConnection();
}
});
_restartConnectionMenuItem.Text(RS_(L"RestartConnectionText"));
_restartConnectionMenuItem.Icon(restartConnectionSymbol);
restartConnectionMenuItem.Text(RS_(L"RestartConnectionText"));
restartConnectionMenuItem.Icon(restartConnectionSymbol);
const auto restartConnectionToolTip = RS_(L"RestartConnectionToolTip");
WUX::Controls::ToolTipService::SetToolTip(_restartConnectionMenuItem, box_value(restartConnectionToolTip));
Automation::AutomationProperties::SetHelpText(_restartConnectionMenuItem, restartConnectionToolTip);
WUX::Controls::ToolTipService::SetToolTip(restartConnectionMenuItem, box_value(restartConnectionToolTip));
Automation::AutomationProperties::SetHelpText(restartConnectionMenuItem, restartConnectionToolTip);
}
// Build the menu
@@ -1867,16 +1759,16 @@ namespace winrt::TerminalApp::implementation
Controls::MenuFlyoutSeparator menuSeparator;
contextMenuFlyout.Items().Append(chooseColorMenuItem);
contextMenuFlyout.Items().Append(renameTabMenuItem);
contextMenuFlyout.Items().Append(_duplicateTabMenuItem);
contextMenuFlyout.Items().Append(_splitTabMenuItem);
contextMenuFlyout.Items().Append(duplicateTabMenuItem);
contextMenuFlyout.Items().Append(splitTabMenuItem);
_AppendMoveMenuItems(contextMenuFlyout);
contextMenuFlyout.Items().Append(_exportTabMenuItem);
contextMenuFlyout.Items().Append(_findMenuItem);
contextMenuFlyout.Items().Append(_restartConnectionMenuItem);
contextMenuFlyout.Items().Append(exportTabMenuItem);
contextMenuFlyout.Items().Append(findMenuItem);
contextMenuFlyout.Items().Append(restartConnectionMenuItem);
contextMenuFlyout.Items().Append(menuSeparator);
auto closeSubMenu = _AppendCloseMenuItems(contextMenuFlyout);
closeSubMenu.Items().Append(_closePaneMenuItem);
closeSubMenu.Items().Append(closePaneMenuItem);
// GH#5750 - When the context menu is dismissed with ESC, toss the focus
// back to our control.

View File

@@ -48,9 +48,6 @@ namespace winrt::TerminalApp::implementation
void ShowBellIndicator(const bool show);
void ActivateBellIndicatorTimer();
void ShowActivityIndicator(const bool show);
void ActivateActivityIndicatorTimer();
float CalcSnappedDimension(const bool widthOrHeight, const float dimension) const;
std::optional<winrt::Microsoft::Terminal::Settings::Model::SplitDirection> PreCalculateCanSplit(winrt::Microsoft::Terminal::Settings::Model::SplitDirection splitType,
const float splitSize,
@@ -124,7 +121,6 @@ namespace winrt::TerminalApp::implementation
til::typed_event<TerminalApp::Tab, IInspectable> ActivePaneChanged;
til::event<winrt::delegate<>> TabRaiseVisualBell;
til::event<winrt::delegate<winrt::hstring /*title*/, winrt::hstring /*body*/>> TabToastNotificationRequested;
til::typed_event<IInspectable, IInspectable> TaskbarProgressChanged;
// The TabViewIndex is the index this Tab object resides in TerminalPage's _tabs vector.
@@ -144,17 +140,11 @@ namespace winrt::TerminalApp::implementation
static constexpr double HeaderRenameBoxWidthTitleLength{ std::numeric_limits<double>::infinity() };
winrt::Windows::UI::Xaml::FocusState _focusState{ winrt::Windows::UI::Xaml::FocusState::Unfocused };
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _duplicateTabMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _splitTabMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeOtherTabsMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeTabsAfterMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _moveToNewWindowMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _moveRightMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _moveLeftMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _exportTabMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _findMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _restartConnectionMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeOtherTabsMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closeTabsAfterMenuItem{};
winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem _closePaneMenuItem{};
winrt::TerminalApp::ShortcutActionDispatch _dispatch;
Microsoft::Terminal::Settings::Model::IActionMapView _actionMap{ nullptr };
winrt::hstring _keyChord{};
@@ -169,6 +159,9 @@ namespace winrt::TerminalApp::implementation
std::shared_ptr<Pane> _activePane{ nullptr };
std::shared_ptr<Pane> _zoomedPane{ nullptr };
Windows::UI::Xaml::Controls::MenuFlyoutItem _closePaneMenuItem;
Windows::UI::Xaml::Controls::MenuFlyoutItem _restartConnectionMenuItem;
winrt::Microsoft::Terminal::Settings::Model::IconStyle _lastIconStyle;
winrt::hstring _lastIconPath{};
std::optional<winrt::Windows::UI::Color> _runtimeTabColor{};
@@ -189,7 +182,6 @@ namespace winrt::TerminalApp::implementation
winrt::TerminalApp::IPaneContent::ConnectionStateChanged_revoker ConnectionStateChanged;
winrt::TerminalApp::IPaneContent::ReadOnlyChanged_revoker ReadOnlyChanged;
winrt::TerminalApp::IPaneContent::FocusRequested_revoker FocusRequested;
winrt::TerminalApp::IPaneContent::NotificationRequested_revoker NotificationRequested;
// These events literally only apply if the content is a TermControl.
winrt::Microsoft::Terminal::Control::TermControl::KeySent_revoker KeySent;
@@ -218,9 +210,6 @@ namespace winrt::TerminalApp::implementation
SafeDispatcherTimer _bellIndicatorTimer;
void _BellIndicatorTimerTick(const Windows::Foundation::IInspectable& sender, const Windows::Foundation::IInspectable& e);
SafeDispatcherTimer _activityIndicatorTimer;
void _ActivityIndicatorTimerTick(const Windows::Foundation::IInspectable& sender, const Windows::Foundation::IInspectable& e);
void _UpdateHeaderControlMaxWidth();
void _CreateContextMenu();
@@ -231,7 +220,6 @@ namespace winrt::TerminalApp::implementation
void _AttachEventHandlersToPane(std::shared_ptr<Pane> pane);
void _UpdateActivePane(std::shared_ptr<Pane> pane);
void _UpdateMenuItemStates();
winrt::hstring _GetActiveTitle() const;
@@ -242,6 +230,8 @@ namespace winrt::TerminalApp::implementation
void _UpdateConnectionClosedState();
void _RestartActivePaneConnection();
void _DuplicateTab();
winrt::Windows::UI::Xaml::Media::Brush _BackgroundBrush();
void _MakeTabViewItem();

View File

@@ -32,12 +32,6 @@
FontSize="12"
Glyph="&#xEA8F;"
Visibility="{x:Bind TabStatus.BellIndicator, Mode=OneWay}" />
<FontIcon x:Name="HeaderActivityIndicator"
Margin="0,0,8,0"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="8"
Glyph="&#xF127;"
Visibility="{x:Bind TabStatus.ActivityIndicator, Mode=OneWay}" />
<FontIcon x:Name="HeaderZoomIcon"
Margin="0,0,8,0"
FontFamily="{ThemeResource SymbolThemeFontFamily}"

View File

@@ -17,7 +17,6 @@
#include "TabRowControl.h"
#include "DebugTapConnection.h"
#include "DesktopNotification.h"
#include "..\TerminalSettingsModel\FileUtils.h"
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
@@ -67,14 +66,14 @@ namespace winrt::TerminalApp::implementation
{
if (const auto& newTerminalArgs{ newContentArgs.try_as<NewTerminalArgs>() })
{
const auto profile{ _settings.GetProfileForArgs(newTerminalArgs) };
const auto profile{ _settings.GetProfileForArgs(newTerminalArgs, _currentWindowSettings()) };
// GH#11114: GetProfileForArgs can return null if the index is higher
// than the number of available profiles.
if (!profile)
{
return S_FALSE;
}
const auto settings{ Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs) };
const auto settings{ Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs, _currentWindowSettings()) };
// Try to handle auto-elevation
if (_maybeElevate(newTerminalArgs, settings, profile))
@@ -106,7 +105,7 @@ namespace winrt::TerminalApp::implementation
if (insertPosition == -1)
{
insertPosition = _tabs.Size();
if (_settings.GlobalSettings().NewTabPosition() == NewTabPosition::AfterCurrentTab)
if (_currentWindowSettings().NewTabPosition() == NewTabPosition::AfterCurrentTab)
{
auto currentTabIndex = _GetFocusedTabIndex();
if (currentTabIndex.has_value())
@@ -151,18 +150,6 @@ namespace winrt::TerminalApp::implementation
}
});
// When a tab requests a desktop toast notification, send the toast
// and handle activation by summoning this window and switching to the tab.
newTabImpl->TabToastNotificationRequested([weakThis{ get_weak() }, weakTab{ newTabImpl->get_weak() }](const winrt::hstring& title, const winrt::hstring& body) {
if (const auto page{ weakThis.get() })
{
if (const auto tab{ weakTab.get() })
{
page->_SendDesktopNotification(title, body, tab);
}
}
});
auto tabViewItem = newTabImpl->TabViewItem();
_tabView.TabItems().InsertAt(insertPosition, tabViewItem);
@@ -233,7 +220,7 @@ namespace winrt::TerminalApp::implementation
if (const auto content{ tab.GetActiveContent() })
{
const auto& icon{ content.Icon() };
const auto theme = _settings.GlobalSettings().CurrentTheme();
const auto theme = _settings.GlobalSettings().CurrentTheme(_currentWindowSettings());
const auto iconStyle = (theme && theme.Tab()) ? theme.Tab().IconStyle() : IconStyle::Default;
tab.UpdateIcon(icon, iconStyle);
@@ -244,7 +231,7 @@ namespace winrt::TerminalApp::implementation
// - Handle changes to the tab width set by the user
void TerminalPage::_UpdateTabWidthMode()
{
_tabView.TabWidthMode(_settings.GlobalSettings().TabWidthMode());
_tabView.TabWidthMode(_currentWindowSettings().TabWidthMode());
}
// Method Description:
@@ -257,9 +244,9 @@ namespace winrt::TerminalApp::implementation
// - there is more than one tab, or the user has chosen to always show tabs
const auto isVisible = !_isInFocusMode &&
(!_isFullscreen || _showTabsFullscreen) &&
(_settings.GlobalSettings().ShowTabsInTitlebar() ||
(_currentWindowSettings().ShowTabsInTitlebar() ||
(_tabs.Size() > 1) ||
_settings.GlobalSettings().AlwaysShowTabs());
_currentWindowSettings().AlwaysShowTabs());
if (_tabView)
{
@@ -299,7 +286,7 @@ namespace winrt::TerminalApp::implementation
// current control's live settings (which will include changes
// made through VT).
uint32_t insertPosition = _tabs.Size();
if (_settings.GlobalSettings().NewTabPosition() == NewTabPosition::AfterCurrentTab)
if (_currentWindowSettings().NewTabPosition() == NewTabPosition::AfterCurrentTab)
{
insertPosition = tab.TabViewIndex() + 1;
}
@@ -407,9 +394,7 @@ namespace winrt::TerminalApp::implementation
// - Removes the tab (both TerminalControl and XAML) after prompting for approval
// Arguments:
// - tab: the tab to remove
// - skipConfirmClose: if true, skip the confirmOnClose check. Used when
// an aggregate confirmation has already been shown (i.e. close other tabs)
winrt::Windows::Foundation::IAsyncAction TerminalPage::_HandleCloseTabRequested(winrt::TerminalApp::Tab tab, bool skipConfirmClose)
winrt::Windows::Foundation::IAsyncAction TerminalPage::_HandleCloseTabRequested(winrt::TerminalApp::Tab tab)
{
winrt::com_ptr<TerminalPage> strong;
@@ -428,24 +413,6 @@ namespace winrt::TerminalApp::implementation
}
}
// Skip the per-tab confirmOnClose check when the caller has already
// shown an aggregate confirmation dialog (e.g. _RemoveTabs).
if (!skipConfirmClose)
{
const auto tabImpl = _GetTabImpl(tab);
if (tabImpl && _ShouldWarnOnCloseTab(tabImpl))
{
const auto weak = get_weak();
auto warningResult = co_await _ShowConfirmCloseDialog(ConfirmCloseDialogKind::Tab);
strong = weak.get();
if (!strong || warningResult != ContentDialogResult::Primary)
{
co_return;
}
}
}
auto t = winrt::get_self<implementation::Tab>(tab);
auto actions = t->BuildStartupActions(BuildStartupKind::None);
_AddPreviouslyClosedPaneOrTab(std::move(actions));
@@ -471,6 +438,21 @@ namespace winrt::TerminalApp::implementation
const auto focusedTabIndex{ _GetFocusedTabIndex() };
// If this is the last tab in a named window, persist the workspace
// layout now—before the tab is shut down—so GetWindowLayout() can
// still see its tab data.
if (_tabs.Size() == 1)
{
const auto& windowName = _WindowProperties.WindowName();
if (!windowName.empty())
{
if (const auto layout = GetWindowLayout())
{
ApplicationState::SharedInstance().SaveWorkspace(windowName, layout);
}
}
}
// Removing the tab from the collection should destroy its control and disconnect its connection,
// but it doesn't always do so. The UI tree may still be holding the control and preventing its destruction.
tab.Shutdown();
@@ -510,7 +492,7 @@ namespace winrt::TerminalApp::implementation
// 1. We want to customize this behavior (e.g., use MRU logic)
// 2. In fullscreen (GH#5799) and focus (GH#7916) modes the _OnTabItemsChanged is not fired
// 3. When rearranging tabs (GH#7916) _OnTabItemsChanged is suppressed
const auto tabSwitchMode = _settings.GlobalSettings().TabSwitcherMode();
const auto tabSwitchMode = _currentWindowSettings().TabSwitcherMode();
if (tabSwitchMode == TabSwitcherMode::MostRecentlyUsed)
{
@@ -561,7 +543,7 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::_SelectNextTab(const bool bMoveRight, const Windows::Foundation::IReference<Microsoft::Terminal::Settings::Model::TabSwitcherMode>& customTabSwitcherMode)
{
const auto index{ _GetFocusedTabIndex().value_or(0) };
const auto tabSwitchMode = customTabSwitcherMode ? customTabSwitcherMode.Value() : _settings.GlobalSettings().TabSwitcherMode();
const auto tabSwitchMode = customTabSwitcherMode ? customTabSwitcherMode.Value() : _currentWindowSettings().TabSwitcherMode();
if (tabSwitchMode == TabSwitcherMode::Disabled)
{
auto tabCount = _tabs.Size();
@@ -815,22 +797,6 @@ namespace winrt::TerminalApp::implementation
if (const auto pane{ activeTab->GetActivePane() })
{
const auto weak = get_weak();
// Check if we should warn before closing a single pane
// (only triggers on Always — Automatic doesn't warn for single pane)
const auto setting = _settings.GlobalSettings().ConfirmOnClose();
if (setting == ConfirmOnClose::Always)
{
// If this is the last pane, closing it closes the tab,
// so use the tab dialog text instead.
const auto kind = activeTab->GetLeafPaneCount() == 1 ? ConfirmCloseDialogKind::Tab : ConfirmCloseDialogKind::Pane;
auto warningResult = co_await _ShowConfirmCloseDialog(kind);
if (!weak.get() || warningResult != ContentDialogResult::Primary)
{
co_return;
}
}
if (co_await _PaneConfirmCloseReadOnly(pane))
{
if (const auto strong = weak.get())
@@ -844,33 +810,10 @@ namespace winrt::TerminalApp::implementation
// Method Description:
// - Close all panes with the given IDs sequentially.
// - Shows a single aggregate confirmation dialog upfront if the confirmOnClose setting warrants it.
// Arguments:
// - weakTab: weak reference to the tab that the panes belong to.
// - weakTab: weak reference to the tab that the pane belongs to.
// - paneIds: collection of the IDs of the panes that are marked for removal.
safe_void_coroutine TerminalPage::_ClosePanes(weak_ref<Tab> weakTab, std::vector<uint32_t> paneIds)
{
// Show a single aggregate confirmation for closing multiple panes.
if (_settings.GlobalSettings().ConfirmOnClose() != ConfirmOnClose::Never)
{
const auto weak = get_weak();
auto warningResult = co_await _ShowConfirmCloseDialog(ConfirmCloseDialogKind::MultiplePanes);
if (!weak.get() || warningResult != ContentDialogResult::Primary)
{
co_return;
}
}
_CloseRemainingPanes(weakTab, std::move(paneIds));
}
// Method Description:
// - Recursively closes panes by ID, chaining each close via the
// ClosedByParent callback. Called after confirmation has already
// been handled by _ClosePanes.
// Arguments:
// - weakTab: weak reference to the tab that the panes belong to
// - paneIds: remaining pane IDs to close
void TerminalPage::_CloseRemainingPanes(weak_ref<Tab> weakTab, std::vector<uint32_t> paneIds)
void TerminalPage::_ClosePanes(weak_ref<Tab> weakTab, std::vector<uint32_t> paneIds)
{
if (auto strongTab{ weakTab.get() })
{
@@ -885,9 +828,10 @@ namespace winrt::TerminalApp::implementation
pane->ClosedByParent([ids{ std::move(paneIds) }, weakThis{ get_weak() }, weakTab]() {
if (auto strongThis{ weakThis.get() })
{
strongThis->_CloseRemainingPanes(weakTab, std::move(ids));
strongThis->_ClosePanes(weakTab, std::move(ids));
}
});
// Close the pane which will eventually trigger the closed by parent event
_HandleClosePaneRequested(pane);
break;
@@ -912,33 +856,18 @@ namespace winrt::TerminalApp::implementation
// Method Description:
// - Closes provided tabs one by one
// - Shows a single aggregate confirmation dialog upfront if the confirmOnClose setting warrants it.
// Arguments:
// - tabs - tabs to remove
safe_void_coroutine TerminalPage::_RemoveTabs(const std::vector<winrt::TerminalApp::Tab> tabs)
{
if (tabs.empty())
{
co_return;
}
// Show a single aggregate confirmation instead of per-tab dialogs.
const auto weak = get_weak();
if (_settings.GlobalSettings().ConfirmOnClose() != ConfirmOnClose::Never)
{
auto warningResult = co_await _ShowConfirmCloseDialog(ConfirmCloseDialogKind::MultipleTabs);
if (!weak.get() || warningResult != ContentDialogResult::Primary)
{
co_return;
}
}
for (auto& tab : tabs)
{
winrt::Windows::Foundation::IAsyncAction action{ nullptr };
if (const auto strong = weak.get())
{
action = _HandleCloseTabRequested(tab, /*skipConfirmClose*/ true);
action = _HandleCloseTabRequested(tab);
}
if (!action)
@@ -1103,7 +1032,7 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::_UpdateBackground(const winrt::Microsoft::Terminal::Settings::Model::Profile& profile)
{
if (profile && _settings.GlobalSettings().UseBackgroundImageForWindow())
if (profile && _currentWindowSettings().UseBackgroundImageForWindow())
{
_SetBackgroundImage(profile.DefaultAppearance());
}
@@ -1271,103 +1200,4 @@ namespace winrt::TerminalApp::implementation
{
return _tabs.Size() > 1;
}
// Method Description:
// - Attempts to find and focus the given tab in this window.
// Arguments:
// - tab: The tab to focus.
// Return Value:
// - true if the tab was found and focused, false otherwise.
bool TerminalPage::FocusTab(const winrt::TerminalApp::Tab& tab)
{
if (const auto tabIndex{ _GetTabIndex(tab) })
{
_SelectTab(tabIndex.value());
return true;
}
return false;
}
// Method Description:
// - Sends a desktop toast notification with the given title and body.
// When the toast is activated (clicked), the window is summoned and
// the originating tab is focused.
// Arguments:
// - tabTitle: The title to display in the notification.
// - body: The body text. If empty, a standard tab-activity message is built.
// - tab: The tab to switch to when the toast is activated.
void TerminalPage::_SendDesktopNotification(const winrt::hstring& tabTitle, const winrt::hstring& body, const winrt::com_ptr<Tab>& tab)
{
// Build the notification message.
// If a custom body is provided (e.g. from OSC 777), use the title/body directly.
// Otherwise, build the standard tab-activity notification message.
winrt::hstring notificationTitle;
winrt::hstring message;
if (!body.empty())
{
notificationTitle = tabTitle;
message = body;
}
else
{
// Use the window name if available for context; otherwise just use the tab title.
// Use the raw WindowName (not WindowNameForDisplay) so we don't include
// the "<unnamed window>" placeholder in the notification body.
const auto windowName = _WindowProperties ? _WindowProperties.WindowName() : winrt::hstring{};
if (!windowName.empty())
{
message = RS_fmt(L"NotificationMessage_TabActivityInWindow", std::wstring_view{ tabTitle }, std::wstring_view{ windowName });
}
else
{
message = RS_fmt(L"NotificationMessage_TabActivity", std::wstring_view{ tabTitle });
}
notificationTitle = CascadiaSettings::ApplicationDisplayName();
}
// Use the Tab object's identity hash as a stable toast tag.
// This survives tab reordering and cross-window moves.
const auto tabHash = std::hash<winrt::Windows::Foundation::IUnknown>{}(*tab);
const hstring tabTag{ fmt::format(FMT_COMPILE(L"wt-tab-{:016x}"), tabHash) };
const implementation::DesktopNotificationArgs args{
.Title = notificationTitle,
.Message = message,
.Tag = tabTag
};
implementation::DesktopNotification::SendNotification(args, [weakThis{ get_weak() }, weakTab{ tab->get_weak() }]() {
if (const auto page{ weakThis.get() })
{
// The toast Activated callback runs on a background thread.
// Marshal to the UI thread for tab focus and window summon.
page->Dispatcher().RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal, [weakThis, weakTab]() {
if (const auto p{ weakThis.get() })
{
if (const auto t{ weakTab.get() })
{
// Try to find and focus the tab in this window first.
if (const auto tabIndex{ p->_GetTabIndex(*t) })
{
p->SummonWindowRequested.raise(nullptr, nullptr);
p->_SelectTab(tabIndex.value());
}
else
{
// The tab may have moved to another window.
// Raise FocusTabRequested so the emperor can
// search all windows for it.
p->FocusTabRequested.raise(nullptr, *t);
}
}
else
{
// Tab was closed. Just summon this window.
p->SummonWindowRequested.raise(nullptr, nullptr);
}
}
});
}
});
}
}

View File

@@ -25,6 +25,21 @@ namespace winrt::TerminalApp::implementation
InitializeComponent();
}
void TabRowControl::WorkspaceName(const winrt::hstring& value)
{
if (_WorkspaceName != value)
{
_WorkspaceName = value;
PropertyChanged.raise(*this, WUX::Data::PropertyChangedEventArgs{ L"WorkspaceName" });
// Collapse the name text when empty so the button shows only the icon.
if (const auto textBlock = WorkspaceNameText())
{
textBlock.Visibility(value.empty() ? WUX::Visibility::Collapsed : WUX::Visibility::Visible);
}
}
}
// Method Description:
// - Bound in the Xaml editor to the [+] button.
// Arguments:

View File

@@ -19,6 +19,14 @@ namespace winrt::TerminalApp::implementation
til::property_changed_event PropertyChanged;
WINRT_OBSERVABLE_PROPERTY(bool, ShowElevationShield, PropertyChanged.raise, false);
WINRT_OBSERVABLE_PROPERTY(bool, ShowWindowsButton, PropertyChanged.raise, true);
public:
winrt::hstring WorkspaceName() const noexcept { return _WorkspaceName; }
void WorkspaceName(const winrt::hstring& value);
private:
winrt::hstring _WorkspaceName{};
};
}

View File

@@ -9,5 +9,7 @@ namespace TerminalApp
TabRowControl();
Microsoft.UI.Xaml.Controls.TabView TabView { get; };
Boolean ShowElevationShield;
Boolean ShowWindowsButton;
String WorkspaceName;
}
}

View File

@@ -35,14 +35,43 @@
TabWidthMode="Equal">
<mux:TabView.TabStripHeader>
<!-- EA18 is the "Shield" glyph -->
<FontIcon x:Uid="ElevationShield"
Margin="9,4,0,4"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="16"
Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}"
Glyph="&#xEA18;"
Visibility="{x:Bind ShowElevationShield, Mode=OneWay}" />
<StackPanel Orientation="Horizontal">
<!-- EA18 is the "Shield" glyph -->
<FontIcon x:Uid="ElevationShield"
Margin="9,4,0,4"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="16"
Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}"
Glyph="&#xEA18;"
Visibility="{x:Bind ShowElevationShield, Mode=OneWay}" />
<!-- Workspace/windows button -->
<Button x:Name="WorkspaceDropdown"
Margin="4,4,0,4"
Padding="8,2,4,2"
VerticalAlignment="Center"
BorderThickness="0"
Background="Transparent"
Visibility="{x:Bind ShowWindowsButton, Mode=OneWay}">
<Button.Content>
<StackPanel Orientation="Horizontal"
Spacing="4">
<!-- EE40 is the "TaskViewSettings" glyph -->
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Glyph="&#xEE40;" />
<TextBlock x:Name="WorkspaceNameText"
VerticalAlignment="Center"
FontSize="12"
Visibility="Collapsed"
Text="{x:Bind WorkspaceName, Mode=OneWay}" />
</StackPanel>
</Button.Content>
<Button.Flyout>
<MenuFlyout x:Name="WorkspaceFlyout" />
</Button.Flyout>
</Button>
</StackPanel>
</mux:TabView.TabStripHeader>
<mux:TabView.TabStripFooter>

View File

@@ -174,7 +174,6 @@
<DependentUpon>TerminalPaneContent.idl</DependentUpon>
</ClInclude>
<ClInclude Include="Toast.h" />
<ClInclude Include="DesktopNotification.h" />
<ClInclude Include="TerminalSettingsCache.h" />
<ClInclude Include="SuggestionsControl.h">
<DependentUpon>SuggestionsControl.xaml</DependentUpon>
@@ -288,7 +287,6 @@
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="Toast.cpp" />
<ClCompile Include="DesktopNotification.cpp" />
<ClCompile Include="TerminalSettingsCache.cpp" />
<ClCompile Include="SuggestionsControl.cpp">
<DependentUpon>SuggestionsControl.xaml</DependentUpon>

View File

@@ -25,6 +25,7 @@
#include "TerminalSettingsCache.h"
#include "LaunchPositionRequest.g.cpp"
#include "WindowListRequest.g.cpp"
#include "RenameWindowRequestedArgs.g.cpp"
#include "RequestMoveContentArgs.g.cpp"
#include "TerminalPage.g.cpp"
@@ -226,6 +227,11 @@ namespace winrt::TerminalApp::implementation
_WindowProperties.PropertyChanged({ get_weak(), &TerminalPage::_windowPropertyChanged });
}
winrt::Microsoft::Terminal::Settings::Model::WindowSettings TerminalPage::_currentWindowSettings() const
{
return _settings.WindowSettings(_WindowProperties.WindowName());
}
// Method Description:
// - implements the IInitializeWithWindow interface from shobjidl_core.
// - We're going to use this HWND as the owner for the ConPTY windows, via
@@ -268,12 +274,19 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::SetSettings(CascadiaSettings settings, bool needRefreshUI)
{
assert(Dispatcher().HasThreadAccess());
if (_settings == nullptr)
// IMPORTANT: we must assign _settings FIRST, because many downstream
// helpers (e.g. _currentWindowSettings()) dereference it. On the very
// first call _settings is nullptr, so any access before this line would
// crash.
const auto firstLoad = _settings == nullptr;
_settings = settings;
if (firstLoad)
{
// Create this only on the first time we load the settings.
_terminalSettingsCache = std::make_shared<TerminalSettingsCache>(settings);
_terminalSettingsCache = std::make_shared<TerminalSettingsCache>(settings, _currentWindowSettings());
}
_settings = settings;
// Make sure to call SetCommands before _RefreshUIForSettingsReload.
// SetCommands will make sure the KeyChordText of Commands is updated, which needs
@@ -334,8 +347,22 @@ namespace winrt::TerminalApp::implementation
auto tabRowImpl = winrt::get_self<implementation::TabRowControl>(_tabRow);
_newTabButton = tabRowImpl->NewTabButton();
_workspaceFlyout = tabRowImpl->WorkspaceFlyout();
if (_settings.GlobalSettings().ShowTabsInTitlebar())
// Set the initial workspace name from the window name.
// Use raw WindowName() so unnamed windows show no text.
_tabRow.WorkspaceName(_WindowProperties.WindowName());
// Rebuild the workspace flyout each time it opens so it always
// reflects the latest set of persisted workspaces.
_workspaceFlyout.Opening([weakThis{ get_weak() }](auto&&, auto&&) {
if (auto page{ weakThis.get() })
{
page->_PopulateWorkspaceFlyout();
}
});
if (_currentWindowSettings().ShowTabsInTitlebar())
{
// Remove the TabView from the page. We'll hang on to it, we need to
// put it in the titlebar.
@@ -370,7 +397,7 @@ namespace winrt::TerminalApp::implementation
// Initialize the state of the CloseButtonOverlayMode property of
// our TabView, to match the tab.showCloseButton property in the theme.
if (const auto theme = _settings.GlobalSettings().CurrentTheme())
if (const auto theme = _settings.GlobalSettings().CurrentTheme(_currentWindowSettings()))
{
const auto visibility = theme.Tab() ? theme.Tab().ShowCloseButton() : Settings::Model::TabCloseButtonVisibility::Always;
@@ -425,7 +452,7 @@ namespace winrt::TerminalApp::implementation
// Settings AllowDependentAnimations will affect whether animations are
// enabled application-wide, so we don't need to check it each time we
// want to create an animation.
WUX::Media::Animation::Timeline::AllowDependentAnimations(!_settings.GlobalSettings().DisableAnimations());
WUX::Media::Animation::Timeline::AllowDependentAnimations(!_currentWindowSettings().DisableAnimations());
// Once the page is actually laid out on the screen, trigger all our
// startup actions. Things like Panes need to know at least how big the
@@ -434,14 +461,20 @@ namespace winrt::TerminalApp::implementation
// _OnFirstLayout will remove this handler so it doesn't get called more than once.
_layoutUpdatedRevoker = _tabContent.LayoutUpdated(winrt::auto_revoke, { this, &TerminalPage::_OnFirstLayout });
_isAlwaysOnTop = _settings.GlobalSettings().AlwaysOnTop();
_showTabsFullscreen = _settings.GlobalSettings().ShowTabsFullscreen();
_isAlwaysOnTop = _currentWindowSettings().AlwaysOnTop();
_showTabsFullscreen = _currentWindowSettings().ShowTabsFullscreen();
// DON'T set up Toasts/TeachingTips here. They should be loaded and
// initialized the first time they're opened, in whatever method opens
// them.
_tabRow.ShowElevationShield(IsRunningElevated() && _settings.GlobalSettings().ShowAdminShield());
_tabRow.ShowElevationShield(IsRunningElevated() && _currentWindowSettings().ShowAdminShield());
// Apply the ShowWindowsButton theme setting.
if (const auto theme = _settings.GlobalSettings().CurrentTheme(_currentWindowSettings()))
{
_tabRow.ShowWindowsButton(theme.Window() ? theme.Window().ShowWindowsButton() : true);
}
_adjustProcessPriorityThrottled = std::make_shared<ThrottledFunc<>>(
DispatcherQueue::GetForCurrentThread(),
@@ -520,7 +553,7 @@ namespace winrt::TerminalApp::implementation
// It's possible that newTerminalArgs is null here.
// GetProfileForArgs should be resilient to that.
const auto profile{ settings.GetProfileForArgs(newTerminalArgs) };
const auto profile{ settings.GetProfileForArgs(newTerminalArgs, settings.WindowSettingsDefaults()) };
if (profile.Elevate())
{
continue;
@@ -884,63 +917,26 @@ namespace winrt::TerminalApp::implementation
}
// Method Description:
// - Displays the unified close confirmation dialog configured for the
// given scenario. Resets the "don't ask me again" checkbox before showing.
// If the user confirms and checked "don't ask me again", sets
// confirmOnClose to Never and writes settings to disk.
// - Displays a dialog to warn the user that they are about to close all open windows.
// Once the user clicks the OK button, shut down the application.
// If cancel is clicked, the dialog will close.
// - Only one dialog can be visible at a time. If another dialog is visible
// when this is called, nothing happens. See _ShowDialog for details
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalPage::_ShowConfirmCloseDialog(ConfirmCloseDialogKind kind)
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalPage::_ShowQuitDialog()
{
// Load the dialog (triggers x:Load) and configure its strings.
const auto dialog = FindName(L"ConfirmCloseDialog").as<ContentDialog>();
switch (kind)
{
case ConfirmCloseDialogKind::CloseAll:
dialog.Title(winrt::box_value(RS_(L"ConfirmCloseDialog_CloseAllTitle")));
dialog.PrimaryButtonText(RS_(L"ConfirmCloseDialog_CloseAllPrimary"));
break;
case ConfirmCloseDialogKind::Window:
dialog.Title(winrt::box_value(RS_(L"ConfirmCloseDialog_WindowTitle")));
dialog.PrimaryButtonText(RS_(L"ConfirmCloseDialog_WindowPrimary"));
break;
case ConfirmCloseDialogKind::Tab:
dialog.Title(winrt::box_value(RS_(L"ConfirmCloseDialog_TabTitle")));
dialog.PrimaryButtonText(RS_(L"ConfirmCloseDialog_TabPrimary"));
break;
case ConfirmCloseDialogKind::MultiplePanes:
dialog.Title(winrt::box_value(RS_(L"ConfirmCloseDialog_MultiplePanesTitle")));
dialog.PrimaryButtonText(RS_(L"ConfirmCloseDialog_MultiplePanesPrimary"));
break;
case ConfirmCloseDialogKind::MultipleTabs:
dialog.Title(winrt::box_value(RS_(L"ConfirmCloseDialog_MultipleTabsTitle")));
dialog.PrimaryButtonText(RS_(L"ConfirmCloseDialog_MultipleTabsPrimary"));
break;
case ConfirmCloseDialogKind::Pane:
dialog.Title(winrt::box_value(RS_(L"ConfirmCloseDialog_PaneTitle")));
dialog.PrimaryButtonText(RS_(L"ConfirmCloseDialog_PanePrimary"));
break;
}
dialog.CloseButtonText(RS_(L"ConfirmCloseDialog_Cancel"));
return _ShowDialogHelper(L"QuitDialog");
}
// BODGY: After a ContentDialog is dismissed, FindName() can no longer
// resolve children inside it. Use Content() to get the checkbox directly.
const auto checkbox = dialog.Content().as<CheckBox>();
checkbox.IsChecked(false);
auto result = ContentDialogResult::None;
if (auto presenter{ _dialogPresenter.get() })
{
result = co_await presenter.ShowDialog(dialog);
}
if (result == ContentDialogResult::Primary && checkbox.IsChecked().Value())
{
_settings.GlobalSettings().ConfirmOnClose(ConfirmOnClose::Never);
_settings.WriteSettingsToDisk();
}
co_return result;
// Method Description:
// - Displays a dialog for warnings found while closing the terminal app using
// key binding with multiple tabs opened. Display messages to warn user
// that more than 1 tab is opened, and once the user clicks the OK button, remove
// all the tabs and shut down and app. If cancel is clicked, the dialog will close
// - Only one dialog can be visible at a time. If another dialog is visible
// when this is called, nothing happens. See _ShowDialog for details
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalPage::_ShowCloseWarningDialog()
{
return _ShowDialogHelper(L"CloseAllDialog");
}
// Method Description:
@@ -988,7 +984,7 @@ namespace winrt::TerminalApp::implementation
// Create profile entries from the NewTabMenu configuration using a
// recursive helper function. This returns a std::vector of FlyoutItemBases,
// that we then add to our Flyout.
auto entries = _settings.GlobalSettings().NewTabMenu();
auto entries = _currentWindowSettings().NewTabMenu();
auto items = _CreateNewTabFlyoutItems(entries);
for (const auto& item : items)
{
@@ -1270,7 +1266,7 @@ namespace winrt::TerminalApp::implementation
profileMenuItem.Icon(icon);
}
if (profile.Guid() == _settings.GlobalSettings().DefaultProfile())
if (profile.Guid() == _currentWindowSettings().DefaultProfile())
{
// Contrast the default profile with others in font weight.
profileMenuItem.FontWeight(FontWeights::Bold());
@@ -1436,7 +1432,7 @@ namespace winrt::TerminalApp::implementation
if (newTerminalArgs.ProfileIndex() != nullptr)
{
// We want to promote the index to a GUID because there is no "launch to profile index" command.
const auto profile = _settings.GetProfileForArgs(newTerminalArgs);
const auto profile = _settings.GetProfileForArgs(newTerminalArgs, _currentWindowSettings());
if (profile)
{
newTerminalArgs.Profile(::Microsoft::Console::Utils::GuidToString(profile.Guid()));
@@ -1507,7 +1503,7 @@ namespace winrt::TerminalApp::implementation
const bool inheritCursor)
{
static const auto textMeasurement = [&]() -> std::wstring_view {
switch (_settings.GlobalSettings().TextMeasurement())
switch (_currentWindowSettings().TextMeasurement())
{
case TextMeasurement::Graphemes:
return L"graphemes";
@@ -1519,9 +1515,6 @@ namespace winrt::TerminalApp::implementation
return {};
}
}();
static const auto ambiguousIsWide = [&]() -> bool {
return _settings.GlobalSettings().AmbiguousWidth() == AmbiguousWidth::Wide;
}();
TerminalConnection::ITerminalConnection connection{ nullptr };
@@ -1587,10 +1580,6 @@ namespace winrt::TerminalApp::implementation
{
valueSet.Insert(L"textMeasurement", Windows::Foundation::PropertyValue::CreateString(textMeasurement));
}
if (ambiguousIsWide)
{
valueSet.Insert(L"ambiguousIsWide", Windows::Foundation::PropertyValue::CreateBoolean(true));
}
if (const auto id = settings.SessionId(); id != winrt::guid{})
{
@@ -1633,11 +1622,12 @@ namespace winrt::TerminalApp::implementation
{
// TODO GH#5047 If we cache the NewTerminalArgs, we no longer need to do this.
profile = GetClosestProfileForDuplicationOfProfile(profile);
controlSettings = Settings::TerminalSettings::CreateWithProfile(_settings, profile);
controlSettings = Settings::TerminalSettings::CreateWithProfile(_settings, profile, _currentWindowSettings());
// Replace the Starting directory with the CWD, if given
const auto workingDirectory = control.WorkingDirectory();
if (Utils::IsValidDirectory(workingDirectory.c_str()))
const auto validWorkingDirectory = !workingDirectory.empty();
if (validWorkingDirectory)
{
controlSettings.DefaultSettings()->StartingDirectory(workingDirectory);
}
@@ -2246,13 +2236,12 @@ namespace winrt::TerminalApp::implementation
// signal that we want to close everything.
safe_void_coroutine TerminalPage::RequestQuit()
{
const auto setting = _settings.GlobalSettings().ConfirmOnClose();
if (setting != ConfirmOnClose::Never && !_displayingCloseDialog)
if (!_displayingCloseDialog)
{
_displayingCloseDialog = true;
const auto weak = get_weak();
auto warningResult = co_await _ShowConfirmCloseDialog(ConfirmCloseDialogKind::CloseAll);
auto warningResult = co_await _ShowQuitDialog();
const auto strong = weak.get();
if (!strong)
{
@@ -2265,19 +2254,19 @@ namespace winrt::TerminalApp::implementation
{
co_return;
}
}
QuitRequested.raise(nullptr, nullptr);
QuitRequested.raise(nullptr, nullptr);
}
}
void TerminalPage::PersistState()
WindowLayout TerminalPage::GetWindowLayout()
{
// This method may be called for a window even if it hasn't had a tab yet or lost all of them.
// We shouldn't persist such windows.
const auto tabCount = _tabs.Size();
if (_startupState != StartupState::Initialized || tabCount == 0)
{
return;
return nullptr;
}
std::vector<ActionAndArgs> actions;
@@ -2292,7 +2281,7 @@ namespace winrt::TerminalApp::implementation
// Avoid persisting a window with zero tabs, because `BuildStartupActions` happened to return an empty vector.
if (actions.empty())
{
return;
return nullptr;
}
// if the focused tab was not the last tab, restore that
@@ -2341,73 +2330,50 @@ namespace winrt::TerminalApp::implementation
RequestLaunchPosition.raise(*this, launchPosRequest);
layout.InitialPosition(launchPosRequest.Position());
ApplicationState::SharedInstance().AppendPersistedWindowLayout(layout);
return layout;
}
// Method Description:
// - Determines whether a close-window action should show a confirmation
// dialog, based on the confirmOnClose setting and the current window state.
// Arguments:
// - <none>
// Return Value:
// - true, if a warning dialog should be shown before closing the window
bool TerminalPage::_ShouldWarnOnClose() const
void TerminalPage::PersistState()
{
const auto setting = _settings.GlobalSettings().ConfirmOnClose();
switch (setting)
if (const auto layout = GetWindowLayout())
{
case ConfirmOnClose::Always:
return true;
case ConfirmOnClose::Automatic:
{
// Warn if there's more than one tab.
if (_HasMultipleTabs())
// For named windows, save the full state into the workspace collection
// and emit a lightweight openWorkspace action in the generic layout.
// This way, restoring generic layouts re-opens workspaces by name
// rather than duplicating their full tab state.
const auto& windowName = _WindowProperties.WindowName();
if (!windowName.empty())
{
return true;
}
// Persist the full layout into the workspace collection.
ApplicationState::SharedInstance().SaveWorkspace(windowName, layout);
// Warn if the one tab has more than one pane.
if (_GetTabImpl(_tabs.GetAt(0))->GetLeafPaneCount() > 1)
{
return true;
// Build a minimal layout with just an openWorkspace action
// so the generic restore path re-opens this workspace by name.
std::vector<ActionAndArgs> actions;
ActionAndArgs action;
action.Action(ShortcutAction::OpenWorkspace);
OpenWorkspaceArgs args{ windowName };
action.Args(args);
actions.emplace_back(std::move(action));
WindowLayout stub;
stub.TabLayout(winrt::single_threaded_vector<ActionAndArgs>(std::move(actions)));
ApplicationState::SharedInstance().AppendPersistedWindowLayout(stub);
}
else
{
ApplicationState::SharedInstance().AppendPersistedWindowLayout(layout);
}
return false;
}
case ConfirmOnClose::Never:
default:
return false;
}
}
// Method Description:
// - Determines whether closing a specific tab should show a confirmation
// dialog, based on the confirmOnClose setting and the tab's state.
// Arguments:
// - tab: The tab being closed
// Return Value:
// - true, if a warning dialog should be shown before closing the tab
bool TerminalPage::_ShouldWarnOnCloseTab(const winrt::com_ptr<Tab>& tab) const
{
const auto setting = _settings.GlobalSettings().ConfirmOnClose();
switch (setting)
{
case ConfirmOnClose::Always:
return true;
case ConfirmOnClose::Automatic:
// Warn if this tab has more than one pane.
return tab->GetLeafPaneCount() > 1;
case ConfirmOnClose::Never:
default:
return false;
}
}
// Method Description:
// - Close the terminal app. If the confirmOnClose setting indicates we should
// warn for the current window state, show a warning dialog.
// - Close the terminal app. If there is more
// than one tab opened, show a warning dialog.
safe_void_coroutine TerminalPage::CloseWindow()
{
if (_ShouldWarnOnClose() &&
if (_HasMultipleTabs() &&
_currentWindowSettings().ConfirmCloseAllTabs() &&
!_displayingCloseDialog)
{
if (_newTabButton && _newTabButton.Flyout())
@@ -2416,14 +2382,7 @@ namespace winrt::TerminalApp::implementation
}
_DismissTabContextMenus();
_displayingCloseDialog = true;
const auto weak = get_weak();
auto warningResult = co_await _ShowConfirmCloseDialog(ConfirmCloseDialogKind::Window);
if (!weak.get())
{
co_return;
}
auto warningResult = co_await _ShowCloseWarningDialog();
_displayingCloseDialog = false;
if (warningResult != ContentDialogResult::Primary)
@@ -2939,7 +2898,7 @@ namespace winrt::TerminalApp::implementation
// - the title of the focused control if there is one, else "Terminal"
hstring TerminalPage::Title()
{
if (_settings.GlobalSettings().ShowTitleInTitlebar())
if (_currentWindowSettings().ShowTitleInTitlebar())
{
if (const auto tab{ _GetFocusedTab() })
{
@@ -3028,7 +2987,7 @@ namespace winrt::TerminalApp::implementation
// - See Pane::CalcSnappedDimension
float TerminalPage::CalcSnappedDimension(const bool widthOrHeight, const float dimension) const
{
if (_settings && _settings.GlobalSettings().SnapToGridOnResize())
if (_settings && _currentWindowSettings().SnapToGridOnResize())
{
if (const auto tabImpl{ _GetFocusedTabImpl() })
{
@@ -3056,7 +3015,7 @@ namespace winrt::TerminalApp::implementation
// the WinRT one on average, depending on CPU load. Don't use the WinRT clipboard API if you can.
const auto weakThis = get_weak();
const auto dispatcher = Dispatcher();
const auto globalSettings = _settings.GlobalSettings();
const auto windowSettings = _currentWindowSettings();
const auto bracketedPaste = eventArgs.BracketedPasteEnabled();
const auto sourceId = sender.try_as<ControlInteractivity>().Id();
@@ -3069,22 +3028,18 @@ namespace winrt::TerminalApp::implementation
text = clipboard::read();
}
if (!bracketedPaste && globalSettings.TrimPaste())
if (!bracketedPaste && windowSettings.TrimPaste())
{
text = winrt::hstring{ Utils::TrimPaste(text) };
}
// LOAD BEARING: Send an empty bracketed paste even if the clipboard was empty.
// Bracketed Paste provides an application a way to know whether the
// user pasted, even if there was no applicable content on it. This
// behavior is observed in GNOME Terminal, among others.
if (!bracketedPaste && text.empty())
if (text.empty())
{
co_return;
}
bool warnMultiLine = false;
switch (globalSettings.WarnAboutMultiLinePaste())
switch (windowSettings.WarnAboutMultiLinePaste())
{
case WarnAboutMultiLinePaste::Automatic:
// NOTE that this is unsafe, because a shell that doesn't support bracketed paste
@@ -3107,7 +3062,7 @@ namespace winrt::TerminalApp::implementation
}
constexpr std::size_t minimumSizeForWarning = 1024 * 5; // 5 KiB
const auto warnLargeText = text.size() > minimumSizeForWarning && globalSettings.WarnAboutLargePaste();
const auto warnLargeText = text.size() > minimumSizeForWarning && windowSettings.WarnAboutLargePaste();
if (warnMultiLine || warnLargeText)
{
@@ -3187,42 +3142,18 @@ namespace winrt::TerminalApp::implementation
}
CATCH_LOG();
safe_void_coroutine TerminalPage::_OpenHyperlinkHandler(const IInspectable /*sender*/, const Microsoft::Terminal::Control::OpenHyperlinkEventArgs eventArgs)
void TerminalPage::_OpenHyperlinkHandler(const IInspectable /*sender*/, const Microsoft::Terminal::Control::OpenHyperlinkEventArgs eventArgs)
{
try
{
auto uriString{ eventArgs.Uri() };
auto parsed = winrt::Windows::Foundation::Uri(uriString);
auto parsed = winrt::Windows::Foundation::Uri(eventArgs.Uri());
if (_IsUriSupported(parsed))
{
bool shouldLaunch{ _IsUriConsideredSomewhatSafe(parsed) };
if (!shouldLaunch)
{
if (auto presenter{ _dialogPresenter.get() })
{
// FindName needs to be called first to actually load the xaml object
auto unopenedUriDialog = FindName(L"UriErrorDialog").try_as<WUX::Controls::ContentDialog>();
// Insert the reason and the URI
unopenedUriDialog.SecondaryButtonText(RS_(L"UnsafeUrlConfirmAllowAction"));
CouldNotOpenUriReason().Text(RS_(L"UnsafeUrlConfirmText"));
UnopenedUri().Text(uriString);
// Show the dialog
auto result = co_await presenter.ShowDialog(unopenedUriDialog);
shouldLaunch = result == ContentDialogResult::Secondary;
}
}
if (shouldLaunch)
{
ShellExecuteW(nullptr, L"open", uriString.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
}
ShellExecute(nullptr, L"open", eventArgs.Uri().c_str(), nullptr, nullptr, SW_SHOWNORMAL);
}
else
{
_ShowCouldNotOpenDialog(RS_(L"UnsupportedSchemeText"), uriString);
_ShowCouldNotOpenDialog(RS_(L"UnsupportedSchemeText"), eventArgs.Uri());
}
}
catch (...)
@@ -3242,10 +3173,9 @@ namespace winrt::TerminalApp::implementation
if (auto presenter{ _dialogPresenter.get() })
{
// FindName needs to be called first to actually load the xaml object
auto unopenedUriDialog = FindName(L"UriErrorDialog").try_as<WUX::Controls::ContentDialog>();
auto unopenedUriDialog = FindName(L"CouldNotOpenUriDialog").try_as<WUX::Controls::ContentDialog>();
// Insert the reason and the URI
unopenedUriDialog.SecondaryButtonText({});
CouldNotOpenUriReason().Text(reason);
UnopenedUri().Text(uri);
@@ -3298,30 +3228,6 @@ namespace winrt::TerminalApp::implementation
return true;
}
bool TerminalPage::_IsUriConsideredSomewhatSafe(const winrt::Windows::Foundation::Uri& parsedUri)
{
if (parsedUri.SchemeName() == L"http" || parsedUri.SchemeName() == L"https")
{
return true;
}
if (parsedUri.SchemeName() == L"file")
{
static const auto pathext{ wil::TryGetEnvironmentVariableW<std::wstring>(L"PATHEXT") };
const auto filename = parsedUri.Path();
for (const auto& e : til::split_iterator{ std::wstring_view{ pathext }, L';' })
{
if (til::ends_with_insensitive_ascii(filename, e))
{
return false;
}
}
return true;
}
return false;
}
// Important! Don't take this eventArgs by reference, we need to extend the
// lifetime of it to the other side of the co_await!
safe_void_coroutine TerminalPage::_ControlNoticeRaisedHandler(const IInspectable /*sender*/,
@@ -3501,13 +3407,13 @@ namespace winrt::TerminalApp::implementation
void TerminalPage::_WindowSizeChanged(const IInspectable sender, const Microsoft::Terminal::Control::WindowSizeChangedEventArgs args)
{
// Raise if:
// - Not in quake mode
// - Not in docked mode
// - Not in fullscreen
// - Only one tab exists
// - Only one pane exists
// else:
// - Reset conpty to its original size back
if (!WindowProperties().IsQuakeWindow() && !Fullscreen() &&
if (!_currentWindowSettings().DockWindow() && !Fullscreen() &&
NumberOfTabs() == 1 && _GetFocusedTabImpl()->GetLeafPaneCount() == 1)
{
WindowSizeChanged.raise(*this, args);
@@ -3691,7 +3597,7 @@ namespace winrt::TerminalApp::implementation
{
// Don't need to worry about duplicating or anything - we'll
// serialize the actual profile's GUID along with the content guid.
const auto& profile = _settings.GetProfileForArgs(newTerminalArgs);
const auto& profile = _settings.GetProfileForArgs(newTerminalArgs, _currentWindowSettings());
const auto control = _AttachControlToContent(newTerminalArgs.ContentId());
auto paneContent{ winrt::make<TerminalPaneContent>(profile, _terminalSettingsCache, control) };
return std::make_shared<Pane>(paneContent);
@@ -3707,9 +3613,10 @@ namespace winrt::TerminalApp::implementation
{
// TODO GH#5047 If we cache the NewTerminalArgs, we no longer need to do this.
profile = GetClosestProfileForDuplicationOfProfile(profile);
controlSettings = Settings::TerminalSettings::CreateWithProfile(_settings, profile);
controlSettings = Settings::TerminalSettings::CreateWithProfile(_settings, profile, _currentWindowSettings());
const auto workingDirectory = tabImpl->GetActiveTerminalControl().WorkingDirectory();
if (Utils::IsValidDirectory(workingDirectory.c_str()))
const auto validWorkingDirectory = !workingDirectory.empty();
if (validWorkingDirectory)
{
controlSettings.DefaultSettings()->StartingDirectory(workingDirectory);
}
@@ -3717,8 +3624,8 @@ namespace winrt::TerminalApp::implementation
}
if (!profile)
{
profile = _settings.GetProfileForArgs(newTerminalArgs);
controlSettings = Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs);
profile = _settings.GetProfileForArgs(newTerminalArgs, _currentWindowSettings());
controlSettings = Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs, _currentWindowSettings());
}
// Try to handle auto-elevation
@@ -3895,13 +3802,7 @@ namespace winrt::TerminalApp::implementation
// for nulls
if (const auto& connection{ _duplicateConnectionForRestart(paneContent) })
{
// Reset the terminal's VT state before attaching the new connection.
// The previous client may have left dirty modes (e.g., bracketed
// paste, mouse tracking, alternate buffer, kitty keyboard) that
// would corrupt input/output for the new shell process.
const auto& termControl = paneContent.GetTermControl();
termControl.HardResetWithoutErase();
termControl.Connection(connection);
paneContent.GetTermControl().Connection(connection);
connection.Start();
}
}
@@ -3915,7 +3816,7 @@ namespace winrt::TerminalApp::implementation
// - <none>
void TerminalPage::_SetBackgroundImage(const winrt::Microsoft::Terminal::Settings::Model::IAppearanceConfig& newAppearance)
{
if (!_settings.GlobalSettings().UseBackgroundImageForWindow())
if (!_currentWindowSettings().UseBackgroundImageForWindow())
{
_tabContent.Background(nullptr);
return;
@@ -3986,7 +3887,7 @@ namespace winrt::TerminalApp::implementation
// updating terminal panes, so that we don't have to build a _new_
// TerminalSettings for every profile we update - we can just look them
// up the previous ones we built.
_terminalSettingsCache->Reset(_settings);
_terminalSettingsCache->Reset(_settings, _currentWindowSettings());
for (const auto& tab : _tabs)
{
@@ -4024,17 +3925,23 @@ namespace winrt::TerminalApp::implementation
// Reload the current value of alwaysOnTop from the settings file. This
// will let the user hot-reload this setting, but any runtime changes to
// the alwaysOnTop setting will be lost.
_isAlwaysOnTop = _settings.GlobalSettings().AlwaysOnTop();
_isAlwaysOnTop = _currentWindowSettings().AlwaysOnTop();
AlwaysOnTopChanged.raise(*this, nullptr);
_showTabsFullscreen = _settings.GlobalSettings().ShowTabsFullscreen();
_showTabsFullscreen = _currentWindowSettings().ShowTabsFullscreen();
// Settings AllowDependentAnimations will affect whether animations are
// enabled application-wide, so we don't need to check it each time we
// want to create an animation.
WUX::Media::Animation::Timeline::AllowDependentAnimations(!_settings.GlobalSettings().DisableAnimations());
WUX::Media::Animation::Timeline::AllowDependentAnimations(!_currentWindowSettings().DisableAnimations());
_tabRow.ShowElevationShield(IsRunningElevated() && _settings.GlobalSettings().ShowAdminShield());
_tabRow.ShowElevationShield(IsRunningElevated() && _currentWindowSettings().ShowAdminShield());
// Apply the ShowWindowsButton theme setting.
if (const auto theme = _settings.GlobalSettings().CurrentTheme(_currentWindowSettings()))
{
_tabRow.ShowWindowsButton(theme.Window() ? theme.Window().ShowWindowsButton() : true);
}
Media::SolidColorBrush transparent{ Windows::UI::Colors::Transparent() };
_tabView.Background(transparent);
@@ -4055,7 +3962,7 @@ namespace winrt::TerminalApp::implementation
// our TabView, to match the tab.showCloseButton property in the theme.
//
// Also update every tab's individual IsClosable to match the same property.
const auto theme = _settings.GlobalSettings().CurrentTheme();
const auto theme = _settings.GlobalSettings().CurrentTheme(_currentWindowSettings());
const auto visibility = (theme && theme.Tab()) ?
theme.Tab().ShowCloseButton() :
Settings::Model::TabCloseButtonVisibility::Always;
@@ -4669,7 +4576,7 @@ namespace winrt::TerminalApp::implementation
// - <none>
void TerminalPage::_UpdateTeachingTipTheme(winrt::Windows::UI::Xaml::FrameworkElement element)
{
auto theme{ _settings.GlobalSettings().CurrentTheme() };
auto theme{ _settings.GlobalSettings().CurrentTheme(_currentWindowSettings()) };
auto requestedTheme{ theme.RequestedTheme() };
while (element)
{
@@ -4822,7 +4729,7 @@ namespace winrt::TerminalApp::implementation
{
if (profile == _settings.ProfileDefaults())
{
return _settings.FindProfile(_settings.GlobalSettings().DefaultProfile());
return _settings.FindProfile(_currentWindowSettings().DefaultProfile());
}
return profile;
}
@@ -5043,7 +4950,7 @@ namespace winrt::TerminalApp::implementation
return;
}
const auto theme = _settings.GlobalSettings().CurrentTheme();
const auto theme = _settings.GlobalSettings().CurrentTheme(_currentWindowSettings());
auto requestedTheme{ theme.RequestedTheme() };
{
@@ -5087,7 +4994,7 @@ namespace winrt::TerminalApp::implementation
theme.TabRow().UnfocusedBackground()) :
ThemeColor{ nullptr } };
if (_settings.GlobalSettings().UseAcrylicInTabRow() && (_activated || _settings.GlobalSettings().EnableUnfocusedAcrylic()))
if (_currentWindowSettings().UseAcrylicInTabRow())
{
if (tabRowBg)
{
@@ -5117,7 +5024,7 @@ namespace winrt::TerminalApp::implementation
TitlebarBrush(backgroundSolidBrush);
}
if (!_settings.GlobalSettings().ShowTabsInTitlebar())
if (!_currentWindowSettings().ShowTabsInTitlebar())
{
_tabRow.Background(TitlebarBrush());
}
@@ -5353,7 +5260,7 @@ namespace winrt::TerminalApp::implementation
// Feature_ShellCompletions::IsEnabled back in _RegisterTerminalEvents
// User must explicitly opt-in on Preview builds
if (!_settings.GlobalSettings().EnableShellCompletionMenu())
if (!_currentWindowSettings().EnableShellCompletionMenu())
{
co_return;
}
@@ -5676,6 +5583,199 @@ namespace winrt::TerminalApp::implementation
}
}
// Rebuild the workspace flyout contents. Called every time the flyout opens
// so it reflects the current set of persisted workspaces.
void TerminalPage::_PopulateWorkspaceFlyout()
{
if (!_workspaceFlyout)
{
return;
}
_workspaceFlyout.Items().Clear();
// --- "Name / Rename this window" ---
{
MenuFlyoutItem item{};
item.Text(winrt::hstring{ _WindowProperties.WindowName().empty() ? L"Name this window\u2026" : L"Rename this window\u2026" });
auto iconElement = UI::IconPathConverter::IconWUX(L"\uE8AC"); // Rename glyph
Automation::AutomationProperties::SetAccessibilityView(iconElement, Automation::Peers::AccessibilityView::Raw);
item.Icon(iconElement);
item.Click([weakThis{ get_weak() }](auto&&, auto&&) {
if (auto page{ weakThis.get() })
{
// Re-use the existing openWindowRenamer action.
page->_actionDispatch->DoAction(ActionAndArgs{ ShortcutAction::OpenWindowRenamer, nullptr });
}
});
_workspaceFlyout.Items().Append(item);
}
// --- "Save workspace" ---
{
MenuFlyoutItem item{};
item.Text(winrt::hstring{ L"Save workspace" });
auto iconElement = UI::IconPathConverter::IconWUX(L"\uE74E"); // Save glyph
Automation::AutomationProperties::SetAccessibilityView(iconElement, Automation::Peers::AccessibilityView::Raw);
item.Icon(iconElement);
// Only enable if the window has a name.
item.IsEnabled(!_WindowProperties.WindowName().empty());
item.Click([weakThis{ get_weak() }](auto&&, auto&&) {
if (auto page{ weakThis.get() })
{
page->_actionDispatch->DoAction(ActionAndArgs{ ShortcutAction::SaveWorkspace, nullptr });
}
});
_workspaceFlyout.Items().Append(item);
}
// --- Gather open window info first so we can filter workspaces ---
// Ask the host (via AppHost → WindowEmperor) for all live windows.
const auto windowListReq{ winrt::make<WindowListRequest>() };
RequestWindowList.raise(*this, windowListReq);
const auto windowEntries = windowListReq.WindowEntries();
// Collect the names of all currently-open windows so we can hide
// workspaces that are already live from the saved-workspaces list.
std::set<winrt::hstring> openWindowNames;
if (windowEntries)
{
for (const auto& entry : windowEntries)
{
const std::wstring_view entryView{ entry };
const auto tabPos = entryView.find(L'\t');
if (tabPos != std::wstring_view::npos)
{
const auto namePart = entryView.substr(tabPos + 1);
if (!namePart.empty())
{
openWindowNames.emplace(namePart);
}
}
}
}
// --- Saved workspaces section (only those not currently open) ---
const auto workspaces = ApplicationState::SharedInstance().AllPersistedWorkspaces();
if (workspaces && workspaces.Size() > 0)
{
bool addedSeparator = false;
for (const auto& pair : workspaces)
{
const auto name = pair.Key();
// Skip workspaces that correspond to a currently-open window.
if (openWindowNames.count(name))
{
continue;
}
if (!addedSeparator)
{
_workspaceFlyout.Items().Append(MenuFlyoutSeparator{});
addedSeparator = true;
}
MenuFlyoutItem item{};
item.Text(name);
auto iconElement = UI::IconPathConverter::IconWUX(L"\uE8F1"); // SwitchApps glyph
Automation::AutomationProperties::SetAccessibilityView(iconElement, Automation::Peers::AccessibilityView::Raw);
item.Icon(iconElement);
item.Click([weakThis{ get_weak() }, name](auto&&, auto&&) {
if (auto page{ weakThis.get() })
{
page->_OpenWorkspaceWindow(name);
}
});
_workspaceFlyout.Items().Append(item);
}
}
// --- Open windows section ---
if (windowEntries && windowEntries.Size() > 0)
{
_workspaceFlyout.Items().Append(MenuFlyoutSeparator{});
const auto thisWindowId = _WindowProperties.WindowId();
for (const auto& entry : windowEntries)
{
// Each entry is formatted as "id\tname"
const std::wstring_view entryView{ entry };
const auto tabPos = entryView.find(L'\t');
if (tabPos == std::wstring_view::npos)
{
continue;
}
uint64_t id = 0;
const auto idPart = entryView.substr(0, tabPos);
for (const auto ch : idPart)
{
if (ch >= L'0' && ch <= L'9')
{
id = id * 10 + (ch - L'0');
}
}
const auto namePart = entryView.substr(tabPos + 1);
// Build display text like "#1: MyWindow" or "#2: <unnamed>"
winrt::hstring displayText;
if (namePart.empty())
{
displayText = winrt::hstring{ fmt::format(FMT_COMPILE(L"#{} (unnamed)"), id) };
}
else
{
displayText = winrt::hstring{ fmt::format(FMT_COMPILE(L"#{}: {}"), id, namePart) };
}
MenuFlyoutItem item{};
item.Text(displayText);
// Use a different glyph for the current window
if (id == thisWindowId)
{
auto iconElement = UI::IconPathConverter::IconWUX(L"\uE73E"); // CheckMark glyph
Automation::AutomationProperties::SetAccessibilityView(iconElement, Automation::Peers::AccessibilityView::Raw);
item.Icon(iconElement);
item.IsEnabled(false); // Can't summon yourself
}
else
{
auto iconElement = UI::IconPathConverter::IconWUX(L"\uE737"); // ChromeRestore glyph
Automation::AutomationProperties::SetAccessibilityView(iconElement, Automation::Peers::AccessibilityView::Raw);
item.Icon(iconElement);
// Click handler: summon the target window by ID.
// We raise SummonWindowByIdRequested which is handled by
// AppHost to directly summon the window without creating
// a new tab (unlike _OpenWorkspaceWindow which launches
// `wt -w <name>` and creates a tab).
item.Click([weakThis{ get_weak() }, id](auto&&, auto&&) {
if (auto page{ weakThis.get() })
{
page->SummonWindowByIdRequested.raise(*page, winrt::make<SummonWindowByIdRequestedArgs>(id));
}
});
}
_workspaceFlyout.Items().Append(item);
}
}
}
// Handler for our WindowProperties's PropertyChanged event. We'll use this
// to pop the "Identify Window" toast when the user renames our window.
void TerminalPage::_windowPropertyChanged(const IInspectable& /*sender*/, const WUX::Data::PropertyChangedEventArgs& args)
@@ -5685,6 +5785,10 @@ namespace winrt::TerminalApp::implementation
return;
}
// Keep the workspace dropdown label in sync with the window name.
// Use raw WindowName() so clearing the name hides the text.
_tabRow.WorkspaceName(_WindowProperties.WindowName());
// DON'T display the confirmation if this is the name we were
// given on startup!
if (_startupState == StartupState::Initialized)

View File

@@ -10,8 +10,10 @@
#include "AppKeyBindings.h"
#include "AppCommandlineArgs.h"
#include "RenameWindowRequestedArgs.g.h"
#include "SummonWindowByIdRequestedArgs.g.h"
#include "RequestMoveContentArgs.g.h"
#include "LaunchPositionRequest.g.h"
#include "WindowListRequest.g.h"
#include "Toast.h"
#include "WindowsPackageManagerFactory.h"
@@ -54,16 +56,6 @@ namespace winrt::TerminalApp::implementation
ScrollDown = 1
};
enum class ConfirmCloseDialogKind
{
Pane,
Tab,
MultiplePanes,
MultipleTabs,
Window,
CloseAll
};
struct RenameWindowRequestedArgs : RenameWindowRequestedArgsT<RenameWindowRequestedArgs>
{
WINRT_PROPERTY(winrt::hstring, ProposedName);
@@ -73,6 +65,15 @@ namespace winrt::TerminalApp::implementation
_ProposedName{ name } {};
};
struct SummonWindowByIdRequestedArgs : SummonWindowByIdRequestedArgsT<SummonWindowByIdRequestedArgs>
{
WINRT_PROPERTY(uint64_t, WindowId);
public:
SummonWindowByIdRequestedArgs(uint64_t id) :
_WindowId{ id } {};
};
struct RequestMoveContentArgs : RequestMoveContentArgsT<RequestMoveContentArgs>
{
WINRT_PROPERTY(winrt::hstring, Window);
@@ -94,6 +95,17 @@ namespace winrt::TerminalApp::implementation
til::property<winrt::Microsoft::Terminal::Settings::Model::LaunchPosition> Position;
};
struct WindowListRequest : WindowListRequestT<WindowListRequest>
{
WindowListRequest() :
_WindowEntries{ winrt::single_threaded_vector<winrt::hstring>() } {}
winrt::Windows::Foundation::Collections::IVector<winrt::hstring> WindowEntries() const { return _WindowEntries; }
private:
winrt::Windows::Foundation::Collections::IVector<winrt::hstring> _WindowEntries;
};
struct WinGetSearchParams
{
winrt::Microsoft::Management::Deployment::PackageMatchField Field;
@@ -132,6 +144,7 @@ namespace winrt::TerminalApp::implementation
safe_void_coroutine RequestQuit();
safe_void_coroutine CloseWindow();
winrt::Microsoft::Terminal::Settings::Model::WindowLayout GetWindowLayout();
void PersistState();
std::vector<IPaneContent> Panes() const;
@@ -178,7 +191,6 @@ namespace winrt::TerminalApp::implementation
void OpenSettingsUI();
void WindowActivated(const bool activated);
bool FocusTab(const winrt::TerminalApp::Tab& tab);
bool OnDirectKeyEvent(const uint32_t vkey, const uint8_t scanCode, const bool down);
@@ -203,7 +215,7 @@ namespace winrt::TerminalApp::implementation
til::typed_event<IInspectable, IInspectable> IdentifyWindowsRequested;
til::typed_event<IInspectable, winrt::TerminalApp::RenameWindowRequestedArgs> RenameWindowRequested;
til::typed_event<IInspectable, IInspectable> SummonWindowRequested;
til::typed_event<IInspectable, winrt::TerminalApp::Tab> FocusTabRequested;
til::typed_event<IInspectable, winrt::TerminalApp::SummonWindowByIdRequestedArgs> SummonWindowByIdRequested;
til::typed_event<IInspectable, winrt::Microsoft::Terminal::Control::WindowSizeChangedEventArgs> WindowSizeChanged;
til::typed_event<IInspectable, IInspectable> OpenSystemMenu;
@@ -215,6 +227,7 @@ namespace winrt::TerminalApp::implementation
til::typed_event<Windows::Foundation::IInspectable, winrt::TerminalApp::RequestReceiveContentArgs> RequestReceiveContent;
til::typed_event<IInspectable, winrt::TerminalApp::LaunchPositionRequest> RequestLaunchPosition;
til::typed_event<IInspectable, winrt::TerminalApp::WindowListRequest> RequestWindowList;
WINRT_OBSERVABLE_PROPERTY(winrt::Windows::UI::Xaml::Media::Brush, TitlebarBrush, PropertyChanged.raise, nullptr);
WINRT_OBSERVABLE_PROPERTY(winrt::Windows::UI::Xaml::Media::Brush, FrameBrush, PropertyChanged.raise, nullptr);
@@ -237,6 +250,7 @@ namespace winrt::TerminalApp::implementation
TerminalApp::TabRowControl _tabRow{ nullptr };
Windows::UI::Xaml::Controls::Grid _tabContent{ nullptr };
Microsoft::UI::Xaml::Controls::SplitButton _newTabButton{ nullptr };
Windows::UI::Xaml::Controls::MenuFlyout _workspaceFlyout{ nullptr };
winrt::TerminalApp::ColorPickupFlyout _tabColorPicker{ nullptr };
Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr };
@@ -295,6 +309,8 @@ namespace winrt::TerminalApp::implementation
TerminalApp::ContentManager _manager{ nullptr };
Microsoft::Terminal::Settings::Model::WindowSettings _currentWindowSettings() const;
std::shared_ptr<TerminalSettingsCache> _terminalSettingsCache{};
struct StashedDragData
@@ -313,7 +329,8 @@ namespace winrt::TerminalApp::implementation
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowDialogHelper(const std::wstring_view& name);
void _ShowAboutDialog();
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowConfirmCloseDialog(ConfirmCloseDialogKind kind);
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowQuitDialog();
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowCloseWarningDialog();
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowCloseReadOnlyDialog();
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowMultiLinePasteWarningDialog();
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowLargePasteWarningDialog();
@@ -335,6 +352,7 @@ namespace winrt::TerminalApp::implementation
void _restartPaneConnection(const TerminalApp::TerminalPaneContent&, const winrt::Windows::Foundation::IInspectable&);
safe_void_coroutine _OpenNewWindow(const Microsoft::Terminal::Settings::Model::INewContentArgs newContentArgs);
safe_void_coroutine _OpenWorkspaceWindow(const winrt::hstring name);
void _OpenNewTerminalViaDropdown(const Microsoft::Terminal::Settings::Model::NewTerminalArgs newTerminalArgs);
@@ -360,7 +378,7 @@ namespace winrt::TerminalApp::implementation
safe_void_coroutine _ExportTab(const Tab& tab, winrt::hstring filepath);
winrt::Windows::Foundation::IAsyncAction _HandleCloseTabRequested(winrt::TerminalApp::Tab tab, bool skipConfirmClose = false);
winrt::Windows::Foundation::IAsyncAction _HandleCloseTabRequested(winrt::TerminalApp::Tab tab);
void _CloseTabAtIndex(uint32_t index);
void _RemoveTab(const winrt::TerminalApp::Tab& tab);
safe_void_coroutine _RemoveTabs(const std::vector<winrt::TerminalApp::Tab> tabs);
@@ -411,12 +429,9 @@ namespace winrt::TerminalApp::implementation
TerminalApp::Tab _GetTabByTabViewItem(const IInspectable& tabViewItem) const noexcept;
void _HandleClosePaneRequested(std::shared_ptr<Pane> pane);
bool _ShouldWarnOnClose() const;
bool _ShouldWarnOnCloseTab(const winrt::com_ptr<Tab>& tab) const;
safe_void_coroutine _SetFocusedTab(const winrt::TerminalApp::Tab tab);
safe_void_coroutine _CloseFocusedPane();
safe_void_coroutine _ClosePanes(weak_ref<Tab> weakTab, std::vector<uint32_t> paneIds);
void _CloseRemainingPanes(weak_ref<Tab> weakTab, std::vector<uint32_t> paneIds);
void _ClosePanes(weak_ref<Tab> weakTab, std::vector<uint32_t> paneIds);
winrt::Windows::Foundation::IAsyncOperation<bool> _PaneConfirmCloseReadOnly(std::shared_ptr<Pane> pane);
void _AddPreviouslyClosedPaneOrTab(std::vector<Microsoft::Terminal::Settings::Model::ActionAndArgs>&& args);
@@ -436,9 +451,8 @@ namespace winrt::TerminalApp::implementation
safe_void_coroutine _PasteFromClipboardHandler(const IInspectable sender,
const Microsoft::Terminal::Control::PasteFromClipboardEventArgs eventArgs);
safe_void_coroutine _OpenHyperlinkHandler(const IInspectable sender, const Microsoft::Terminal::Control::OpenHyperlinkEventArgs eventArgs);
static bool _IsUriSupported(const winrt::Windows::Foundation::Uri& parsedUri);
static bool _IsUriConsideredSomewhatSafe(const winrt::Windows::Foundation::Uri& parsedUri);
void _OpenHyperlinkHandler(const IInspectable sender, const Microsoft::Terminal::Control::OpenHyperlinkEventArgs eventArgs);
bool _IsUriSupported(const winrt::Windows::Foundation::Uri& parsedUri);
void _ShowCouldNotOpenDialog(winrt::hstring reason, winrt::hstring uri);
bool _CopyText(bool dismissSelection, bool singleLine, bool withControlSequences, Microsoft::Terminal::Control::CopyFormat formats);
@@ -577,6 +591,7 @@ namespace winrt::TerminalApp::implementation
void _PopulateContextMenu(const Microsoft::Terminal::Control::TermControl& control, const Microsoft::UI::Xaml::Controls::CommandBarFlyout& sender, const bool withSelection);
void _PopulateQuickFixMenu(const Microsoft::Terminal::Control::TermControl& control, const Windows::UI::Xaml::Controls::MenuFlyout& sender);
void _PopulateWorkspaceFlyout();
winrt::Windows::UI::Xaml::Controls::MenuFlyout _CreateRunAsAdminFlyout(int profileIndex);
winrt::Microsoft::Terminal::Control::TermControl _senderOrActiveControl(const winrt::Windows::Foundation::IInspectable& sender);
@@ -585,8 +600,6 @@ namespace winrt::TerminalApp::implementation
void _activePaneChanged(winrt::TerminalApp::Tab tab, Windows::Foundation::IInspectable args);
safe_void_coroutine _doHandleSuggestions(Microsoft::Terminal::Settings::Model::SuggestionsArgs realArgs);
void _SendDesktopNotification(const winrt::hstring& tabTitle, const winrt::hstring& body, const winrt::com_ptr<Tab>& tab);
#pragma region ActionHandlers
// These are all defined in AppActionHandlers.cpp
#define ON_ALL_ACTIONS(action) DECLARE_ACTION_HANDLER(action);

View File

@@ -19,6 +19,10 @@ namespace TerminalApp
{
String ProposedName { get; };
};
[default_interface] runtimeclass SummonWindowByIdRequestedArgs
{
UInt64 WindowId { get; };
};
[default_interface] runtimeclass RequestMoveContentArgs
{
String Window { get; };
@@ -41,8 +45,6 @@ namespace TerminalApp
String VirtualWorkingDirectory { get; set; };
String VirtualEnvVars { get; set; };
Boolean IsQuakeWindow();
};
runtimeclass LaunchPositionRequest
@@ -50,6 +52,14 @@ namespace TerminalApp
Microsoft.Terminal.Settings.Model.LaunchPosition Position;
}
// Raised by TerminalPage when it needs the list of open windows.
// The handler (AppHost) fills WindowNames synchronously.
[default_interface] runtimeclass WindowListRequest
{
// Each entry is "id\tname" (name may be empty for unnamed windows).
Windows.Foundation.Collections.IVector<String> WindowEntries { get; };
}
[default_interface] runtimeclass TerminalPage : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged, Microsoft.Terminal.UI.IDirectKeyListener
{
TerminalPage(WindowProperties properties, ContentManager manager);
@@ -93,6 +103,7 @@ namespace TerminalApp
event Windows.Foundation.TypedEventHandler<Object, Object> IdentifyWindowsRequested;
event Windows.Foundation.TypedEventHandler<Object, RenameWindowRequestedArgs> RenameWindowRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> SummonWindowRequested;
event Windows.Foundation.TypedEventHandler<Object, SummonWindowByIdRequestedArgs> SummonWindowByIdRequested;
event Windows.Foundation.TypedEventHandler<Object, Microsoft.Terminal.Control.WindowSizeChangedEventArgs> WindowSizeChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> OpenSystemMenu;
@@ -103,5 +114,6 @@ namespace TerminalApp
event Windows.Foundation.TypedEventHandler<Object, RequestReceiveContentArgs> RequestReceiveContent;
event Windows.Foundation.TypedEventHandler<Object, LaunchPositionRequest> RequestLaunchPosition;
event Windows.Foundation.TypedEventHandler<Object, WindowListRequest> RequestWindowList;
}
}

View File

@@ -86,12 +86,17 @@
Grid.Row="2"
x:Load="False" />
<ContentDialog x:Name="ConfirmCloseDialog"
<ContentDialog x:Name="QuitDialog"
x:Uid="QuitDialog"
Grid.Row="2"
x:Load="False"
DefaultButton="Primary">
<CheckBox x:Uid="DontAskAgainCheckBox" />
</ContentDialog>
DefaultButton="Primary" />
<ContentDialog x:Name="CloseAllDialog"
x:Uid="CloseAllDialog"
Grid.Row="2"
x:Load="False"
DefaultButton="Primary" />
<ContentDialog x:Name="CloseReadOnlyDialog"
x:Uid="CloseReadOnlyDialog"
@@ -139,17 +144,17 @@
</TextBlock>
</ContentDialog>
<ContentDialog x:Name="UriErrorDialog"
x:Uid="UriErrorDialog"
<ContentDialog x:Name="CouldNotOpenUriDialog"
x:Uid="CouldNotOpenUriDialog"
Grid.Row="2"
x:Load="False"
DefaultButton="Close">
DefaultButton="Primary">
<TextBlock IsTextSelectionEnabled="True"
TextWrapping="WrapWholeWords">
<TextBlock.ContextFlyout>
<mtu:TextMenuFlyout />
</TextBlock.ContextFlyout>
<Run x:Name="CouldNotOpenUriReason" /> <LineBreak /> <LineBreak />
<Run x:Name="CouldNotOpenUriReason" /> <LineBreak />
<Run x:Name="UnopenedUri"
FontFamily="Cascadia Mono" />
</TextBlock>

View File

@@ -10,7 +10,6 @@
#include "../../types/inc/utils.hpp"
#include "BellEventArgs.g.cpp"
#include "NotificationEventArgs.g.cpp"
#include "TerminalPaneContent.g.cpp"
using namespace winrt::Windows::Foundation;
@@ -35,8 +34,6 @@ namespace winrt::TerminalApp::implementation
{
_controlEvents._ConnectionStateChanged = _control.ConnectionStateChanged(winrt::auto_revoke, { this, &TerminalPaneContent::_controlConnectionStateChangedHandler });
_controlEvents._WarningBell = _control.WarningBell(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_controlWarningBellHandler });
_controlEvents._PromptStarted = _control.PromptStarted(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_controlPromptStartedHandler });
_controlEvents._OutputStarted = _control.OutputStarted(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_controlOutputStartedHandler });
_controlEvents._CloseTerminalRequested = _control.CloseTerminalRequested(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_closeTerminalRequestedHandler });
_controlEvents._RestartTerminalRequested = _control.RestartTerminalRequested(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_restartTerminalRequestedHandler });
@@ -45,8 +42,6 @@ namespace winrt::TerminalApp::implementation
_controlEvents._SetTaskbarProgress = _control.SetTaskbarProgress(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_controlSetTaskbarProgress });
_controlEvents._ReadOnlyChanged = _control.ReadOnlyChanged(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_controlReadOnlyChanged });
_controlEvents._FocusFollowMouseRequested = _control.FocusFollowMouseRequested(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_controlFocusFollowMouseRequested });
_controlEvents._OutputIdle = _control.OutputIdle(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_controlOutputIdleHandler });
_controlEvents._ShowNotification = _control.ShowNotification(winrt::auto_revoke, { get_weak(), &TerminalPaneContent::_controlShowNotification });
}
void TerminalPaneContent::_removeControlEvents()
{
@@ -107,7 +102,7 @@ namespace winrt::TerminalApp::implementation
args.Profile(::Microsoft::Console::Utils::GuidToString(_profile.Guid()));
// If we know the user's working directory use it instead of the profile.
if (const auto dir = _control.WorkingDirectory(); ::Microsoft::Console::Utils::IsValidDirectory(dir.c_str()))
if (const auto dir = _control.WorkingDirectory(); !dir.empty())
{
args.StartingDirectory(dir);
}
@@ -178,30 +173,6 @@ namespace winrt::TerminalApp::implementation
{
TaskbarProgressChanged.raise(*this, nullptr);
}
uint64_t TerminalPaneContent::TaskbarState()
{
const auto vtState = _control.TaskbarState();
if (vtState != 0)
{
return vtState;
}
if (_autoDetectActive)
{
return 3; // Indeterminate
}
return 0;
}
uint64_t TerminalPaneContent::TaskbarProgress()
{
const auto vtState = _control.TaskbarState();
if (vtState != 0)
{
return _control.TaskbarProgress();
}
return 0;
}
void TerminalPaneContent::_controlReadOnlyChanged(const IInspectable&, const IInspectable&)
{
ReadOnlyChanged.raise(*this, nullptr);
@@ -211,11 +182,6 @@ namespace winrt::TerminalApp::implementation
FocusRequested.raise(*this, nullptr);
}
void TerminalPaneContent::_controlShowNotification(const IInspectable& /*sender*/, const ShowNotificationEventArgs& args)
{
NotificationRequested.raise(*this, winrt::make<implementation::NotificationEventArgs>(winrt::Microsoft::Terminal::Control::OutputNotificationStyle::Notification, false, args.Title(), args.Body()));
}
// Method Description:
// - Called when our attached control is closed. Triggers listeners to our close
// event, if we're a leaf pane.
@@ -295,25 +261,6 @@ namespace winrt::TerminalApp::implementation
// has the 'visual' flag set
// Arguments:
// - <unused>
void TerminalPaneContent::PlayNotificationSound()
{
if (_profile)
{
auto sounds{ _profile.BellSound() };
if (sounds && sounds.Size() > 0)
{
winrt::hstring soundPath{ sounds.GetAt(rand() % sounds.Size()).Resolved() };
winrt::Windows::Foundation::Uri uri{ soundPath };
_playBellSound(uri);
}
else
{
const auto soundAlias = reinterpret_cast<LPCTSTR>(SND_ALIAS_SYSTEMHAND);
PlaySound(soundAlias, NULL, SND_ALIAS_ID | SND_ASYNC | SND_SENTRY);
}
}
}
void TerminalPaneContent::_controlWarningBellHandler(const winrt::Windows::Foundation::IInspectable& /*sender*/,
const winrt::Windows::Foundation::IInspectable& /*eventArgs*/)
{
@@ -325,7 +272,18 @@ namespace winrt::TerminalApp::implementation
if (WI_IsFlagSet(_profile.BellStyle(), winrt::Microsoft::Terminal::Settings::Model::BellStyle::Audible))
{
// Audible is set, play the sound
PlayNotificationSound();
auto sounds{ _profile.BellSound() };
if (sounds && sounds.Size() > 0)
{
winrt::hstring soundPath{ sounds.GetAt(rand() % sounds.Size()).Resolved() };
winrt::Windows::Foundation::Uri uri{ soundPath };
_playBellSound(uri);
}
else
{
const auto soundAlias = reinterpret_cast<LPCTSTR>(SND_ALIAS_SYSTEMHAND);
PlaySound(soundAlias, NULL, SND_ALIAS_ID | SND_ASYNC | SND_SENTRY);
}
}
if (WI_IsFlagSet(_profile.BellStyle(), winrt::Microsoft::Terminal::Settings::Model::BellStyle::Window))
@@ -333,60 +291,9 @@ namespace winrt::TerminalApp::implementation
_control.BellLightOn();
}
// raise the event with the bool values corresponding to the taskbar and notification flags
// raise the event with the bool value corresponding to the taskbar flag
BellRequested.raise(*this,
*winrt::make_self<TerminalApp::implementation::BellEventArgs>(
WI_IsFlagSet(_profile.BellStyle(), BellStyle::Taskbar),
WI_IsFlagSet(_profile.BellStyle(), BellStyle::Notification)));
}
}
}
void TerminalPaneContent::_controlPromptStartedHandler(const winrt::Windows::Foundation::IInspectable& /*sender*/,
const winrt::Windows::Foundation::IInspectable& /*eventArgs*/)
{
if (_profile)
{
const auto notifyStyle = _profile.NotifyOnNextPrompt();
if (static_cast<int>(notifyStyle) != 0)
{
NotificationRequested.raise(*this,
*winrt::make_self<TerminalApp::implementation::NotificationEventArgs>(notifyStyle, true));
}
const auto autoDetect = _profile.AutoDetectRunningCommand();
if (autoDetect != AutoDetectRunningCommand::Disabled && _autoDetectActive)
{
_autoDetectActive = false;
TaskbarProgressChanged.raise(*this, nullptr);
}
}
}
void TerminalPaneContent::_controlOutputStartedHandler(const winrt::Windows::Foundation::IInspectable& /*sender*/,
const winrt::Windows::Foundation::IInspectable& /*eventArgs*/)
{
if (_profile)
{
const auto autoDetect = _profile.AutoDetectRunningCommand();
if (autoDetect != AutoDetectRunningCommand::Disabled && !_autoDetectActive)
{
_autoDetectActive = true;
TaskbarProgressChanged.raise(*this, nullptr);
}
}
}
void TerminalPaneContent::_controlOutputIdleHandler(const winrt::Windows::Foundation::IInspectable& /*sender*/,
const winrt::Windows::Foundation::IInspectable& /*eventArgs*/)
{
if (_profile)
{
const auto notifyStyle = _profile.NotifyOnInactiveOutput();
if (static_cast<int>(notifyStyle) != 0)
{
NotificationRequested.raise(*this,
*winrt::make_self<TerminalApp::implementation::NotificationEventArgs>(notifyStyle, true));
*winrt::make_self<TerminalApp::implementation::BellEventArgs>(WI_IsFlagSet(_profile.BellStyle(), BellStyle::Taskbar)));
}
}
}

View File

@@ -4,7 +4,6 @@
#pragma once
#include "TerminalPaneContent.g.h"
#include "BellEventArgs.g.h"
#include "NotificationEventArgs.g.h"
#include "BasicPaneEvents.h"
namespace winrt::TerminalApp::implementation
@@ -14,23 +13,10 @@ namespace winrt::TerminalApp::implementation
struct BellEventArgs : public BellEventArgsT<BellEventArgs>
{
public:
BellEventArgs(bool flashTaskbar, bool sendNotification) :
FlashTaskbar(flashTaskbar), SendNotification(sendNotification) {}
BellEventArgs(bool flashTaskbar) :
FlashTaskbar(flashTaskbar) {}
til::property<bool> FlashTaskbar;
til::property<bool> SendNotification;
};
struct NotificationEventArgs : public NotificationEventArgsT<NotificationEventArgs>
{
public:
NotificationEventArgs(winrt::Microsoft::Terminal::Control::OutputNotificationStyle style, bool onlyWhenInactive = false, const winrt::hstring& title = {}, const winrt::hstring& body = {}) :
Style(style), OnlyWhenInactive(onlyWhenInactive), Title(title), Body(body) {}
til::property<winrt::Microsoft::Terminal::Control::OutputNotificationStyle> Style;
til::property<bool> OnlyWhenInactive;
til::property<winrt::hstring> Title;
til::property<winrt::hstring> Body;
};
struct TerminalPaneContent : TerminalPaneContentT<TerminalPaneContent>, BasicPaneEvents
@@ -50,7 +36,6 @@ namespace winrt::TerminalApp::implementation
void UpdateSettings(const winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings& settings);
void MarkAsDefterm();
void PlayNotificationSound();
winrt::Microsoft::Terminal::Settings::Model::Profile GetProfile() const
{
@@ -58,8 +43,8 @@ namespace winrt::TerminalApp::implementation
}
winrt::hstring Title() { return _control.Title(); }
uint64_t TaskbarState();
uint64_t TaskbarProgress();
uint64_t TaskbarState() { return _control.TaskbarState(); }
uint64_t TaskbarProgress() { return _control.TaskbarProgress(); }
bool ReadOnly() { return _control.ReadOnly(); }
winrt::hstring Icon() const;
Windows::Foundation::IReference<winrt::Windows::UI::Color> TabColor() const noexcept;
@@ -81,15 +66,11 @@ namespace winrt::TerminalApp::implementation
winrt::Windows::Media::Playback::MediaPlayer _bellPlayer{ nullptr };
bool _bellPlayerCreated{ false };
std::atomic<bool> _autoDetectActive{ false };
struct ControlEventTokens
{
winrt::Microsoft::Terminal::Control::TermControl::ConnectionStateChanged_revoker _ConnectionStateChanged;
winrt::Microsoft::Terminal::Control::TermControl::WarningBell_revoker _WarningBell;
winrt::Microsoft::Terminal::Control::TermControl::PromptStarted_revoker _PromptStarted;
winrt::Microsoft::Terminal::Control::TermControl::OutputStarted_revoker _OutputStarted;
winrt::Microsoft::Terminal::Control::TermControl::OutputIdle_revoker _OutputIdle;
winrt::Microsoft::Terminal::Control::TermControl::CloseTerminalRequested_revoker _CloseTerminalRequested;
winrt::Microsoft::Terminal::Control::TermControl::RestartTerminalRequested_revoker _RestartTerminalRequested;
@@ -98,7 +79,6 @@ namespace winrt::TerminalApp::implementation
winrt::Microsoft::Terminal::Control::TermControl::SetTaskbarProgress_revoker _SetTaskbarProgress;
winrt::Microsoft::Terminal::Control::TermControl::ReadOnlyChanged_revoker _ReadOnlyChanged;
winrt::Microsoft::Terminal::Control::TermControl::FocusFollowMouseRequested_revoker _FocusFollowMouseRequested;
winrt::Microsoft::Terminal::Control::TermControl::ShowNotification_revoker _ShowNotification;
} _controlEvents;
void _setupControlEvents();
@@ -109,9 +89,6 @@ namespace winrt::TerminalApp::implementation
safe_void_coroutine _controlConnectionStateChangedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& /*args*/);
void _controlWarningBellHandler(const winrt::Windows::Foundation::IInspectable& sender,
const winrt::Windows::Foundation::IInspectable& e);
void _controlPromptStartedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& eventArgs);
void _controlOutputStartedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& eventArgs);
void _controlOutputIdleHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& eventArgs);
void _controlReadOnlyChangedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& e);
void _controlTitleChanged(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args);
@@ -119,7 +96,6 @@ namespace winrt::TerminalApp::implementation
void _controlSetTaskbarProgress(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args);
void _controlReadOnlyChanged(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args);
void _controlFocusFollowMouseRequested(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args);
void _controlShowNotification(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Microsoft::Terminal::Control::ShowNotificationEventArgs& args);
void _closeTerminalRequestedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& /*args*/);
void _restartTerminalRequestedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& /*args*/);

View File

@@ -11,7 +11,6 @@ namespace TerminalApp
Microsoft.Terminal.Control.TermControl GetTermControl();
void MarkAsDefterm();
void PlayNotificationSound();
Microsoft.Terminal.Settings.Model.Profile GetProfile();

View File

@@ -18,9 +18,9 @@ namespace winrt::TerminalApp::implementation
result.UnfocusedSettings().try_as(_unfocusedSettings);
}
TerminalSettingsCache::TerminalSettingsCache(const MTSM::CascadiaSettings& settings)
TerminalSettingsCache::TerminalSettingsCache(const MTSM::CascadiaSettings& settings, const MTSM::WindowSettings& windowSettings)
{
Reset(settings);
Reset(settings, windowSettings);
}
std::optional<TerminalSettingsPair> TerminalSettingsCache::TryLookup(const MTSM::Profile& profile)
@@ -35,7 +35,7 @@ namespace winrt::TerminalApp::implementation
auto& pair{ found->second };
if (!pair.second)
{
pair.second = winrt::Microsoft::Terminal::Settings::TerminalSettings::CreateWithProfile(_settings, pair.first);
pair.second = winrt::Microsoft::Terminal::Settings::TerminalSettings::CreateWithProfile(_settings, pair.first, _windowSettings);
}
return std::optional{ TerminalSettingsPair{ *pair.second } };
}
@@ -43,9 +43,10 @@ namespace winrt::TerminalApp::implementation
return std::nullopt;
}
void TerminalSettingsCache::Reset(const MTSM::CascadiaSettings& settings)
void TerminalSettingsCache::Reset(const MTSM::CascadiaSettings& settings, const MTSM::WindowSettings& windowSettings)
{
_settings = settings;
_windowSettings = windowSettings;
// Mapping by GUID isn't _excellent_ because the defaults profile doesn't have a stable GUID; however,
// when we stabilize its guid this will become fully safe.

View File

@@ -38,12 +38,13 @@ namespace winrt::TerminalApp::implementation
struct TerminalSettingsCache
{
TerminalSettingsCache(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings);
TerminalSettingsCache(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const Microsoft::Terminal::Settings::Model::WindowSettings& windowSettings);
std::optional<TerminalSettingsPair> TryLookup(const Microsoft::Terminal::Settings::Model::Profile& profile);
void Reset(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings);
void Reset(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const Microsoft::Terminal::Settings::Model::WindowSettings& windowSettings);
private:
Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr };
Microsoft::Terminal::Settings::Model::WindowSettings _windowSettings{ nullptr };
std::unordered_map<winrt::guid, std::pair<Microsoft::Terminal::Settings::Model::Profile, std::optional<winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult>>> profileGuidSettingsMap;
};
}

View File

@@ -17,7 +17,6 @@ namespace winrt::TerminalApp::implementation
WINRT_OBSERVABLE_PROPERTY(bool, IsProgressRingActive, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(bool, IsProgressRingIndeterminate, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(bool, BellIndicator, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(bool, ActivityIndicator, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(bool, IsReadOnlyActive, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(uint32_t, ProgressValue, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(bool, IsInputBroadcastActive, PropertyChanged.raise);

View File

@@ -12,7 +12,6 @@ namespace TerminalApp
Boolean IsProgressRingActive { get; set; };
Boolean IsProgressRingIndeterminate { get; set; };
Boolean BellIndicator { get; set; };
Boolean ActivityIndicator { get; set; };
UInt32 ProgressValue { get; set; };
Boolean IsReadOnlyActive { get; set; };
Boolean IsInputBroadcastActive { get; set; };

View File

@@ -232,7 +232,7 @@ namespace winrt::TerminalApp::implementation
// that the window size is _first_ set up as something sensible, so
// leaving fullscreen returns to a reasonable size.
const auto launchMode = this->GetLaunchMode();
if (_WindowProperties->IsQuakeWindow() || WI_IsFlagSet(launchMode, LaunchMode::FocusMode))
if (WI_IsFlagSet(launchMode, LaunchMode::FocusMode))
{
_root->SetFocusMode(true);
}
@@ -244,7 +244,7 @@ namespace winrt::TerminalApp::implementation
_root->Maximized(true);
}
if (WI_IsFlagSet(launchMode, LaunchMode::FullscreenMode) && !_WindowProperties->IsQuakeWindow())
if (WI_IsFlagSet(launchMode, LaunchMode::FullscreenMode))
{
_root->SetFullscreen(true);
}
@@ -252,6 +252,15 @@ namespace winrt::TerminalApp::implementation
AppLogic::Current()->NotifyRootInitialized();
}
WindowLayout TerminalWindow::GetWindowLayout()
{
if (_root)
{
return _root->GetWindowLayout();
}
return nullptr;
}
void TerminalWindow::PersistState()
{
if (_root)
@@ -267,22 +276,22 @@ namespace winrt::TerminalApp::implementation
bool TerminalWindow::GetShowTabsInTitlebar()
{
return _settings.GlobalSettings().ShowTabsInTitlebar();
return _currentWindowSettings().ShowTabsInTitlebar();
}
bool TerminalWindow::GetInitialAlwaysOnTop()
{
return _settings.GlobalSettings().AlwaysOnTop();
return _currentWindowSettings().AlwaysOnTop();
}
bool TerminalWindow::GetInitialShowTabsFullscreen()
{
return _settings.GlobalSettings().ShowTabsFullscreen();
return _currentWindowSettings().ShowTabsFullscreen();
}
bool TerminalWindow::GetMinimizeToNotificationArea()
{
return _settings.GlobalSettings().MinimizeToNotificationArea();
return _currentWindowSettings().MinimizeToNotificationArea();
}
bool TerminalWindow::GetAlwaysShowNotificationIcon()
@@ -292,12 +301,12 @@ namespace winrt::TerminalApp::implementation
bool TerminalWindow::GetShowTitleInTitlebar()
{
return _settings.GlobalSettings().ShowTitleInTitlebar();
return _currentWindowSettings().ShowTitleInTitlebar();
}
Microsoft::Terminal::Settings::Model::Theme TerminalWindow::Theme()
{
return _settings.GlobalSettings().CurrentTheme();
return _settings.GlobalSettings().CurrentTheme(_currentWindowSettings());
}
// WinUI can't show 2 dialogs simultaneously. Yes, really. If you do, you get an exception.
@@ -374,7 +383,7 @@ namespace winrt::TerminalApp::implementation
auto themingLambda{ [weak](const Windows::Foundation::IInspectable& sender, const RoutedEventArgs&) {
if (const auto strong = weak.get())
{
auto theme{ strong->_settings.GlobalSettings().CurrentTheme() };
auto theme{ strong->_settings.GlobalSettings().CurrentTheme(strong->_currentWindowSettings()) };
auto requestedTheme{ theme.RequestedTheme() };
auto element{ sender.try_as<winrt::Windows::UI::Xaml::FrameworkElement>() };
while (element)
@@ -598,7 +607,7 @@ namespace winrt::TerminalApp::implementation
// --focusMode on the commandline here, and the mode in the settings.
// Below, we'll also account for if focus mode was persisted into the
// session for restoration.
bool focusMode = _appArgs && _appArgs->ParsedArgs().GetLaunchMode().value_or(_settings.GlobalSettings().LaunchMode()) == LaunchMode::FocusMode;
bool focusMode = _appArgs && _appArgs->ParsedArgs().GetLaunchMode().value_or(_currentWindowSettings().LaunchMode()) == LaunchMode::FocusMode;
const auto scale = static_cast<float>(dpi) / static_cast<float>(USER_DEFAULT_SCREEN_DPI);
if (const auto layout = LoadPersistedLayout())
@@ -621,7 +630,7 @@ namespace winrt::TerminalApp::implementation
if ((_appArgs && _appArgs->ParsedArgs().GetSize().has_value()) || (proposedSize.Width == 0 && proposedSize.Height == 0))
{
// Use the default profile to determine how big of a window we need.
const auto settings{ Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, nullptr) };
const auto settings{ Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, nullptr, _currentWindowSettings()) };
const til::size emptySize{};
const auto commandlineSize = _appArgs ? _appArgs->ParsedArgs().GetSize().value_or(emptySize) : til::size{};
@@ -645,7 +654,7 @@ namespace winrt::TerminalApp::implementation
// GH#2061 - If the global setting "Always show tab bar" is
// set or if "Show tabs in title bar" is set, then we'll need to add
// the height of the tab bar here.
if (_settings.GlobalSettings().ShowTabsInTitlebar() && !focusMode)
if (_currentWindowSettings().ShowTabsInTitlebar() && !focusMode)
{
// In the past, we used to actually instantiate a TitlebarControl
// and use Measure() to determine the DesiredSize of the control, to
@@ -663,7 +672,7 @@ namespace winrt::TerminalApp::implementation
static constexpr auto titlebarHeight = 40;
proposedSize.Height += (titlebarHeight)*scale;
}
else if (_settings.GlobalSettings().AlwaysShowTabs() && !focusMode)
else if (_currentWindowSettings().AlwaysShowTabs() && !focusMode)
{
// Same comment as above, but with a TabRowControl.
//
@@ -696,7 +705,7 @@ namespace winrt::TerminalApp::implementation
// GH#4620/#5801 - If the user passed --maximized or --fullscreen on the
// commandline, then use that to override the value from the settings.
const auto valueFromSettings = _settings.GlobalSettings().LaunchMode();
const auto valueFromSettings = _currentWindowSettings().LaunchMode();
const auto valueFromCommandlineArgs = _appArgs ? _appArgs->ParsedArgs().GetLaunchMode() : std::nullopt;
if (const auto layout = LoadPersistedLayout())
{
@@ -722,7 +731,7 @@ namespace winrt::TerminalApp::implementation
// - a point containing the requested initial position in pixels.
TerminalApp::InitialPosition TerminalWindow::GetInitialPosition(int64_t defaultInitialX, int64_t defaultInitialY)
{
auto initialPosition{ _settings.GlobalSettings().InitialPosition() };
auto initialPosition{ _currentWindowSettings().InitialPosition() };
if (const auto layout = LoadPersistedLayout())
{
@@ -770,10 +779,15 @@ namespace winrt::TerminalApp::implementation
return !_contentBounds &&
!hadPersistedPosition &&
_settings.GlobalSettings().CenterOnLaunch() &&
_currentWindowSettings().CenterOnLaunch() &&
(_appArgs && !_appArgs->ParsedArgs().GetPosition().has_value());
}
Microsoft::Terminal::Settings::Model::Docking TerminalWindow::Docking()
{
return _currentWindowSettings().DockWindow();
}
// Method Description:
// - See Pane::CalcSnappedDimension
float TerminalWindow::CalcSnappedDimension(const bool widthOrHeight, const float dimension) const
@@ -1097,6 +1111,11 @@ namespace winrt::TerminalApp::implementation
_initialContentArgs = wil::to_vector(args);
}
void TerminalWindow::SetPersistedLayout(const winrt::Microsoft::Terminal::Settings::Model::WindowLayout& layout)
{
_cachedLayout = layout;
}
// Method Description:
// - Parse the provided commandline arguments into actions, and try to
// perform them immediately.
@@ -1188,7 +1207,7 @@ namespace winrt::TerminalApp::implementation
bool TerminalWindow::AutoHideWindow()
{
return _settings.GlobalSettings().AutoHideWindow();
return _currentWindowSettings().AutoHideWindow();
}
void TerminalWindow::UpdateSettingsHandler(const winrt::IInspectable& /*sender*/,
@@ -1205,32 +1224,24 @@ namespace winrt::TerminalApp::implementation
}
}
bool TerminalWindow::FocusTab(const winrt::TerminalApp::Tab& tab)
{
if (_root)
{
return _root->FocusTab(tab);
}
return false;
}
void TerminalWindow::WindowName(const winrt::hstring& name)
{
const auto oldIsQuakeMode = _WindowProperties->IsQuakeWindow();
const auto oldName = _WindowProperties->WindowName();
_WindowProperties->WindowName(name);
if (!_root)
if (!_root || oldName == name)
{
return;
}
const auto newIsQuakeMode = _WindowProperties->IsQuakeWindow();
if (newIsQuakeMode != oldIsQuakeMode)
{
// If we're entering Quake Mode from ~Focus Mode, then this will enter Focus Mode
// If we're entering Quake Mode from Focus Mode, then this will do nothing
// If we're leaving Quake Mode (we're already in Focus Mode), then this will do nothing
_root->SetFocusMode(true);
IsQuakeWindowChanged.raise(*this, nullptr);
}
// The window name determines which WindowSettings we use
// (via _currentWindowSettings()). Since it changed, refresh
// all downstream consumers of per-window settings:
// - TerminalPage (settings cache, tab/pane settings)
// - Theme (may differ per window)
// - Docking & host-level properties (via IsQuakeWindowChanged -> AppHost)
_root->SetSettings(_settings, true);
_RefreshThemeRoutine();
IsQuakeWindowChanged.raise(*this, nullptr);
}
void TerminalWindow::WindowId(const uint64_t& id)
{
@@ -1341,13 +1352,13 @@ namespace winrt::TerminalApp::implementation
if (!FocusMode())
{
if (!_settings.GlobalSettings().AlwaysShowTabs())
if (!_currentWindowSettings().AlwaysShowTabs())
{
// Hide the title bar = off, Always show tabs = off.
static constexpr auto titlebarHeight = 10;
pixelSize.Height += (titlebarHeight)*scale;
}
else if (!_settings.GlobalSettings().ShowTabsInTitlebar())
else if (!_currentWindowSettings().ShowTabsInTitlebar())
{
// Hide the title bar = off, Always show tabs = on.
static constexpr auto titlebarAndTabBarHeight = 40;
@@ -1428,9 +1439,9 @@ namespace winrt::TerminalApp::implementation
return _WindowName.empty() ? til::hstring_format(FMT_COMPILE(L"<{}>"), RS_(L"UnnamedWindowName")) : _WindowName;
}
bool WindowProperties::IsQuakeWindow() const noexcept
WindowSettings TerminalWindow::_currentWindowSettings() const
{
return _WindowName == L"_quake";
return _settings.WindowSettings(_WindowProperties->WindowName());
}
};

View File

@@ -44,7 +44,6 @@ namespace winrt::TerminalApp::implementation
void WindowId(const uint64_t& value);
winrt::hstring WindowIdForDisplay() const noexcept;
winrt::hstring WindowNameForDisplay() const noexcept;
bool IsQuakeWindow() const noexcept;
til::property_changed_event PropertyChanged;
@@ -71,6 +70,7 @@ namespace winrt::TerminalApp::implementation
void Create();
winrt::Microsoft::Terminal::Settings::Model::WindowLayout GetWindowLayout();
void PersistState();
void UpdateSettings(winrt::TerminalApp::SettingsLoadEventArgs args);
@@ -79,6 +79,7 @@ namespace winrt::TerminalApp::implementation
int32_t SetStartupCommandline(TerminalApp::CommandlineArgs args);
void SetStartupContent(const winrt::hstring& content, const Windows::Foundation::IReference<Windows::Foundation::Rect>& contentBounds);
void SetPersistedLayout(const winrt::Microsoft::Terminal::Settings::Model::WindowLayout& layout);
int32_t ExecuteCommandline(TerminalApp::CommandlineArgs args);
void SetSettingsStartupArgs(const std::vector<winrt::Microsoft::Terminal::Settings::Model::ActionAndArgs>& actions);
@@ -92,7 +93,6 @@ namespace winrt::TerminalApp::implementation
bool ShowTabsFullscreen() const;
bool AutoHideWindow();
void IdentifyWindow();
bool FocusTab(const winrt::TerminalApp::Tab& tab);
std::optional<uint32_t> LoadPersistedLayoutIdx() const;
winrt::Microsoft::Terminal::Settings::Model::WindowLayout LoadPersistedLayout();
@@ -135,12 +135,12 @@ namespace winrt::TerminalApp::implementation
void DismissDialog();
Microsoft::Terminal::Settings::Model::Theme Theme();
Microsoft::Terminal::Settings::Model::Docking Docking();
void UpdateSettingsHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::TerminalApp::SettingsLoadEventArgs& arg);
void WindowName(const winrt::hstring& value);
void WindowId(const uint64_t& value);
bool IsQuakeWindow() const noexcept { return _WindowProperties->IsQuakeWindow(); }
TerminalApp::WindowProperties WindowProperties() { return *_WindowProperties; }
void AttachContent(winrt::hstring content, uint32_t tabIndex);
@@ -188,6 +188,8 @@ namespace winrt::TerminalApp::implementation
TerminalApp::ContentManager _manager{ nullptr };
std::vector<Microsoft::Terminal::Settings::Model::ActionAndArgs> _initialContentArgs;
Microsoft::Terminal::Settings::Model::WindowSettings _currentWindowSettings() const;
void _ShowLoadErrorsDialog(const winrt::hstring& titleKey,
const winrt::hstring& contentKey,
HRESULT settingsLoadedResult,
@@ -222,7 +224,7 @@ namespace winrt::TerminalApp::implementation
FORWARDED_TYPED_EVENT(SetTaskbarProgress, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, _root, SetTaskbarProgress);
FORWARDED_TYPED_EVENT(IdentifyWindowsRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, IdentifyWindowsRequested);
FORWARDED_TYPED_EVENT(SummonWindowRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, SummonWindowRequested);
FORWARDED_TYPED_EVENT(FocusTabRequested, Windows::Foundation::IInspectable, winrt::TerminalApp::Tab, _root, FocusTabRequested);
FORWARDED_TYPED_EVENT(SummonWindowByIdRequested, Windows::Foundation::IInspectable, winrt::TerminalApp::SummonWindowByIdRequestedArgs, _root, SummonWindowByIdRequested);
FORWARDED_TYPED_EVENT(OpenSystemMenu, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, OpenSystemMenu);
FORWARDED_TYPED_EVENT(QuitRequested, Windows::Foundation::IInspectable, Windows::Foundation::IInspectable, _root, QuitRequested);
FORWARDED_TYPED_EVENT(ShowWindowChanged, Windows::Foundation::IInspectable, winrt::Microsoft::Terminal::Control::ShowWindowArgs, _root, ShowWindowChanged);
@@ -231,6 +233,7 @@ namespace winrt::TerminalApp::implementation
FORWARDED_TYPED_EVENT(RequestReceiveContent, Windows::Foundation::IInspectable, winrt::TerminalApp::RequestReceiveContentArgs, _root, RequestReceiveContent);
FORWARDED_TYPED_EVENT(RequestLaunchPosition, Windows::Foundation::IInspectable, winrt::TerminalApp::LaunchPositionRequest, _root, RequestLaunchPosition);
FORWARDED_TYPED_EVENT(RequestWindowList, Windows::Foundation::IInspectable, winrt::TerminalApp::WindowListRequest, _root, RequestWindowList);
#ifdef UNIT_TESTING
friend class TerminalAppLocalTests::CommandlineTest;

View File

@@ -4,7 +4,6 @@
import "IPaneContent.idl";
import "TerminalPage.idl";
import "ShortcutActionDispatch.idl";
import "Tab.idl";
namespace TerminalApp
{
@@ -56,11 +55,13 @@ namespace TerminalApp
Int32 SetStartupCommandline(CommandlineArgs args);
void SetStartupContent(String json, Windows.Foundation.IReference<Windows.Foundation.Rect> bounds);
void SetPersistedLayout(Microsoft.Terminal.Settings.Model.WindowLayout layout);
Int32 ExecuteCommandline(CommandlineArgs args);
Boolean ShouldImmediatelyHandoffToElevated();
void HandoffToElevated();
Microsoft.Terminal.Settings.Model.WindowLayout GetWindowLayout();
void PersistState();
Windows.UI.Xaml.UIElement GetRoot();
@@ -73,9 +74,10 @@ namespace TerminalApp
Boolean AlwaysOnTop { get; };
Boolean AutoHideWindow { get; };
Boolean ShowTabsFullscreen { get; };
Microsoft.Terminal.Settings.Model.Theme Theme { get; };
Microsoft.Terminal.Settings.Model.Docking Docking { get; };
void IdentifyWindow();
Boolean FocusTab(TerminalApp.Tab tab);
void SetPersistedLayoutIdx(UInt32 idx);
void RequestExitFullscreen();
@@ -107,7 +109,6 @@ namespace TerminalApp
WindowProperties WindowProperties { get; };
void WindowName(String name);
void WindowId(UInt64 id);
Boolean IsQuakeWindow();
// See IDialogPresenter and TerminalPage's DialogPresenter for more
// information.
@@ -128,7 +129,7 @@ namespace TerminalApp
event Windows.Foundation.TypedEventHandler<Object, Object> IdentifyWindowsRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> IsQuakeWindowChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> SummonWindowRequested;
event Windows.Foundation.TypedEventHandler<Object, TerminalApp.Tab> FocusTabRequested;
event Windows.Foundation.TypedEventHandler<Object, SummonWindowByIdRequestedArgs> SummonWindowByIdRequested;
event Windows.Foundation.TypedEventHandler<Object, Object> OpenSystemMenu;
event Windows.Foundation.TypedEventHandler<Object, Object> QuitRequested;
event Windows.Foundation.TypedEventHandler<Object, TerminalApp.SystemMenuChangeArgs> SystemMenuChangeRequested;
@@ -140,6 +141,7 @@ namespace TerminalApp
event Windows.Foundation.TypedEventHandler<Object, RequestMoveContentArgs> RequestMoveContent;
event Windows.Foundation.TypedEventHandler<Object, RequestReceiveContentArgs> RequestReceiveContent;
event Windows.Foundation.TypedEventHandler<Object, LaunchPositionRequest> RequestLaunchPosition;
event Windows.Foundation.TypedEventHandler<Object, WindowListRequest> RequestWindowList;
void AttachContent(String content, UInt32 tabIndex);
void SendContentToOther(RequestReceiveContentArgs args);

View File

@@ -54,9 +54,6 @@
#include <winrt/Windows.Media.Playback.h>
#include <winrt/Windows.Management.Deployment.h>
#include <winrt/Windows.UI.Notifications.h>
#include <winrt/Windows.Data.Xml.Dom.h>
#include <winrt/Microsoft.UI.Xaml.Controls.h>
#include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>

View File

@@ -289,11 +289,6 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
}
}
if (unbox_prop_or<bool>(settings, L"ambiguousIsWide", false))
{
_flags |= PSEUDOCONSOLE_AMBIGUOUS_IS_WIDE;
}
const auto& initialEnvironment{ unbox_prop_or<winrt::hstring>(settings, L"initialEnvironment", L"") };
const bool reloadEnvironmentVariables = unbox_prop_or<bool>(settings, L"reloadEnvironmentVariables", false);

View File

@@ -85,12 +85,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
break;
}
CodepointWidthDetector::Singleton().Reset(mode);
if (settings.AmbiguousWidth() == AmbiguousWidth::Wide)
{
CodepointWidthDetector::Singleton().SetAmbiguousWidth(2);
}
return true;
}();
@@ -139,15 +133,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
auto pfnSearchMissingCommand = [this](auto&& PH1, auto&& PH2) { _terminalSearchMissingCommand(std::forward<decltype(PH1)>(PH1), std::forward<decltype(PH2)>(PH2)); };
_terminal->SetSearchMissingCommandCallback(pfnSearchMissingCommand);
auto pfnPromptStarted = [this] { _terminalPromptStarted(); };
_terminal->SetPromptStartedCallback(pfnPromptStarted);
auto pfnOutputStarted = [this] { _terminalOutputStarted(); };
_terminal->SetOutputStartedCallback(pfnOutputStarted);
auto pfnShowNotification = [this](auto&& PH1, auto&& PH2) { _terminalShowNotification(std::forward<decltype(PH1)>(PH1), std::forward<decltype(PH2)>(PH2)); };
_terminal->SetShowNotificationCallback(pfnShowNotification);
auto pfnClearQuickFix = [this] { ClearQuickFix(); };
_terminal->SetClearQuickFixCallback(pfnClearQuickFix);
@@ -364,12 +349,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
}
void ControlCore::HardResetWithoutErase()
{
const auto lock = _terminal->LockForWriting();
_terminal->HardResetWithoutErase();
}
bool ControlCore::Initialize(const float actualWidth,
const float actualHeight,
const float compositionScale)
@@ -1605,31 +1584,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// Since this can only ever be triggered by output from the connection,
// then the Terminal already has the write lock when calling this
// callback.
if (_restoring)
{
return;
}
WarningBell.raise(*this, nullptr);
}
void ControlCore::_terminalPromptStarted()
{
if (_restoring)
{
return;
}
PromptStarted.raise(*this, nullptr);
}
void ControlCore::_terminalOutputStarted()
{
if (_restoring)
{
return;
}
OutputStarted.raise(*this, nullptr);
}
// Method Description:
// - Called for the Terminal's TitleChanged callback. This will re-raise
// a new winrt TypedEvent that can be listened to.
@@ -1687,10 +1644,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void ControlCore::_terminalTaskbarProgressChanged()
{
if (_restoring)
{
return;
}
TaskbarProgressChanged.raise(*this, nullptr);
}
@@ -1708,10 +1661,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// - duration - How long the note should be sustained (in microseconds).
void ControlCore::_terminalPlayMidiNote(const int noteNumber, const int velocity, const std::chrono::microseconds duration)
{
if (_restoring)
{
return;
}
// The UI thread might try to acquire the console lock from time to time.
// --> Unlock it, so the UI doesn't hang while we're busy.
const auto suspension = _terminal->SuspendLock();
@@ -1730,11 +1679,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
SearchMissingCommand.raise(*this, make<implementation::SearchMissingCommandEventArgs>(hstring{ missingCommand }, bufferRow));
}
void ControlCore::_terminalShowNotification(std::wstring_view title, std::wstring_view body)
{
ShowNotification.raise(*this, make<implementation::ShowNotificationEventArgs>(hstring{ title }, hstring{ body }));
}
void ControlCore::OpenCWD()
{
const auto workingDirectory = WorkingDirectory();
@@ -1889,10 +1833,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_terminal->SerializeMainBuffer(handle);
}
void ControlCore::RestoreFromPath(const wchar_t* path)
void ControlCore::RestoreFromPath(const wchar_t* path) const
{
_restoring = true;
const auto restoreComplete = wil::scope_exit([&] { _restoring = false; });
wil::unique_handle file{ CreateFileW(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, nullptr) };
// This block of code exists temporarily to fix buffer dumps that were
@@ -2127,10 +2069,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// the selection (we need to reset selection on double-click or
// triple-click, so it captures the word or the line, rather than
// extending the selection)
// - GH#9608: VT mouse mode is enabled. In this mode, Shift is used
// to override mouse input, so Shift+Click should start a fresh
// selection rather than extending the previous one.
if (_terminal->IsSelectionActive() && (!shiftEnabled || isOnOriginalPosition || _terminal->IsTrackingMouseInput()))
if (_terminal->IsSelectionActive() && (!shiftEnabled || isOnOriginalPosition))
{
// Reset the selection
_terminal->ClearSelection();
@@ -2472,6 +2411,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return *context;
}
winrt::hstring ControlCore::CurrentWorkingDirectory() const
{
return winrt::hstring{ _terminal->GetWorkingDirectory() };
}
bool ControlCore::QuickFixesAvailable() const noexcept
{
return _cachedQuickFixes && _cachedQuickFixes.Size() > 0;

View File

@@ -154,7 +154,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void Close();
void PersistTo(HANDLE handle) const;
void RestoreFromPath(const wchar_t* path);
void RestoreFromPath(const wchar_t* path) const;
void ClearQuickFix();
@@ -191,6 +191,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void ContextMenuSelectCommand();
void ContextMenuSelectOutput();
winrt::hstring CurrentWorkingDirectory() const;
#pragma endregion
#pragma region ITerminalInput
@@ -255,7 +257,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
TerminalConnection::ITerminalConnection Connection();
void Connection(const TerminalConnection::ITerminalConnection& connection);
void HardResetWithoutErase();
void AnchorContextMenu(til::point viewportRelativeCharacterPosition);
@@ -275,8 +276,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
til::typed_event<IInspectable, Control::TitleChangedEventArgs> TitleChanged;
til::typed_event<IInspectable, Control::WriteToClipboardEventArgs> WriteToClipboard;
til::typed_event<> WarningBell;
til::typed_event<> PromptStarted;
til::typed_event<> OutputStarted;
til::typed_event<> TabColorChanged;
til::typed_event<> BackgroundColorChanged;
til::typed_event<IInspectable, Control::ScrollPositionChangedArgs> ScrollPositionChanged;
@@ -294,7 +293,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
til::typed_event<IInspectable, Control::OpenHyperlinkEventArgs> OpenHyperlink;
til::typed_event<IInspectable, Control::CompletionsChangedEventArgs> CompletionsChanged;
til::typed_event<IInspectable, Control::SearchMissingCommandEventArgs> SearchMissingCommand;
til::typed_event<IInspectable, Control::ShowNotificationEventArgs> ShowNotification;
til::typed_event<> RefreshQuickFixUI;
til::typed_event<IInspectable, Control::WindowSizeChangedEventArgs> WindowSizeChanged;
@@ -326,8 +324,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
#pragma region TerminalCoreCallbacks
void _terminalWarningBell();
void _terminalPromptStarted();
void _terminalOutputStarted();
void _terminalTitleChanged(std::wstring_view wstr);
void _terminalScrollPositionChanged(const int viewTop,
const int viewHeight,
@@ -338,7 +334,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const int velocity,
const std::chrono::microseconds duration);
void _terminalSearchMissingCommand(std::wstring_view missingCommand, const til::CoordType& bufferRow);
void _terminalShowNotification(std::wstring_view title, std::wstring_view body);
void _terminalWindowSizeChanged(int32_t width, int32_t height);
void _terminalCompletionsChanged(std::wstring_view menuJson, unsigned int replaceLength);
@@ -425,7 +420,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
std::optional<til::point> _lastHoveredCell;
uint16_t _lastHoveredId{ 0 };
std::atomic<bool> _initializedTerminal{ false };
std::atomic<bool> _restoring{ false };
bool _isReadOnly{ false };
bool _closing{ false };

View File

@@ -98,7 +98,6 @@ namespace Microsoft.Terminal.Control
void ApplyAppearance(Boolean focused);
Microsoft.Terminal.TerminalConnection.ITerminalConnection Connection;
void HardResetWithoutErase();
IControlSettings Settings { get; };
IControlAppearance FocusedAppearance { get; };
@@ -192,15 +191,12 @@ namespace Microsoft.Terminal.Control
event Windows.Foundation.TypedEventHandler<Object, TitleChangedEventArgs> TitleChanged;
event Windows.Foundation.TypedEventHandler<Object, WriteToClipboardEventArgs> WriteToClipboard;
event Windows.Foundation.TypedEventHandler<Object, Object> WarningBell;
event Windows.Foundation.TypedEventHandler<Object, Object> PromptStarted;
event Windows.Foundation.TypedEventHandler<Object, Object> OutputStarted;
event Windows.Foundation.TypedEventHandler<Object, Object> TabColorChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> BackgroundColorChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> TaskbarProgressChanged;
event Windows.Foundation.TypedEventHandler<Object, Object> RendererEnteredErrorState;
event Windows.Foundation.TypedEventHandler<Object, ShowWindowArgs> ShowWindowChanged;
event Windows.Foundation.TypedEventHandler<Object, SearchMissingCommandEventArgs> SearchMissingCommand;
event Windows.Foundation.TypedEventHandler<Object, ShowNotificationEventArgs> ShowNotification;
event Windows.Foundation.TypedEventHandler<Object, Object> RefreshQuickFixUI;
event Windows.Foundation.TypedEventHandler<Object, WindowSizeChangedEventArgs> WindowSizeChanged;

View File

@@ -54,20 +54,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
self->Attached.raise(*self, nullptr);
}
});
// GH#14464: Mark mode and quick-edit (shift+arrow) selections update
// the selection through ControlCore, bypassing SetEndSelectionPoint.
// Listen for selection changes so _selectionNeedsToBeCopied is set
// for ALL selection types, not just mouse drag.
_core->UpdateSelectionMarkers([weakThis = get_weak()](auto&&, auto&&) {
if (auto self{ weakThis.get() })
{
if (self->_core->HasSelection())
{
self->_selectionNeedsToBeCopied = true;
}
}
});
}
uint64_t ControlInteractivity::Id()
@@ -169,8 +155,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void ControlInteractivity::GotFocus()
{
_focused = true;
if (_uiaEngine.get())
{
THROW_IF_FAILED(_uiaEngine->Enable());
@@ -183,8 +167,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void ControlInteractivity::LostFocus()
{
_focused = false;
if (_uiaEngine.get())
{
THROW_IF_FAILED(_uiaEngine->Disable());
@@ -252,8 +234,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
PasteFromClipboard.raise(*this, std::move(args));
}
void ControlInteractivity::PointerPressed(const uint32_t /*pointerId*/,
Control::MouseButtonState buttonState,
void ControlInteractivity::PointerPressed(Control::MouseButtonState buttonState,
const unsigned int pointerUpdateKind,
const uint64_t timestamp,
const ::Microsoft::Terminal::Core::ControlKeyStates modifiers,
@@ -266,10 +247,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const auto shiftEnabled = modifiers.IsShiftPressed();
const auto ctrlEnabled = modifiers.IsCtrlPressed();
// Mark that this pointer event actually started within our bounds.
// We'll need this later, for PointerMoved events.
_pointerPressedInBounds = true;
// GH#9396: we prioritize hyper-link over VT mouse events
auto hyperlink = _core->GetHyperlink(terminalPosition.to_core_point());
if (WI_IsFlagSet(buttonState, MouseButtonState::IsLeftButtonDown) &&
@@ -308,12 +285,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
const auto isOnOriginalPosition = _lastMouseClickPosNoSelection == pixelPosition;
// Rounded coordinates for text selection.
// Don't round in VT mouse mode; cell-level precision matters more.
// Only round for single-click: for double/triple-click, rounding
// can push the position to the next cell, selecting the wrong word.
const auto round = multiClickMapper == 1 && !_core->IsVtMouseModeEnabled();
_core->LeftClickOnTerminal(_getTerminalPosition(til::point{ pixelPosition }, round),
// Rounded coordinates for text selection
_core->LeftClickOnTerminal(_getTerminalPosition(til::point{ pixelPosition }, true),
multiClickMapper,
altEnabled,
shiftEnabled,
@@ -323,15 +296,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
if (_core->HasSelection())
{
// GH#9787: if selection is active we don't want to track the touchdown position
// so that dragging the mouse will extend the selection rather than starting the new one.
// In VT mouse mode, keep tracking the touchdown point so that PointerMoved
// can re-anchor the selection based on drag direction (the dx < 0 adjustment).
// Without this, dragging left wouldn't include the initially clicked cell
// because floored coordinates place the anchor on the cell's left edge.
if (!_core->IsVtMouseModeEnabled())
{
_singleClickTouchdownPos = std::nullopt;
}
// so that dragging the mouse will extend the selection rather than starting the new one
_singleClickTouchdownPos = std::nullopt;
}
}
else if (WI_IsFlagSet(buttonState, MouseButtonState::IsRightButtonDown))
@@ -348,41 +314,37 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
else
{
// GH#19942, GH#14464: Don't re-copy a selection that was
// already copied via copyOnSelect on mouse-up. But DO copy
// if the selection was made via mark mode or modified with
// quick-edit keys (shift+arrow), since those paths never
// triggered an automatic copy.
const auto copied = (_selectionNeedsToBeCopied || !_core->CopyOnSelect()) &&
CopySelectionToClipboard(shiftEnabled, false, _core->Settings().CopyFormatting());
// Try to copy the text and clear the selection
const auto successfulCopy = CopySelectionToClipboard(shiftEnabled, false, _core->Settings().CopyFormatting());
_core->ClearSelection();
if (_core->CopyOnSelect() || !copied)
if (_core->CopyOnSelect() || !successfulCopy)
{
// CopyOnSelect: right-click always pastes.
// Otherwise: no selection paste.
// CopyOnSelect: right click always pastes!
// Otherwise: no selection --> paste
RequestPasteTextFromClipboard();
}
}
}
}
void ControlInteractivity::TouchPressed(const Core::Point contactPoint)
void ControlInteractivity::TouchPressed(const winrt::Windows::Foundation::Point contactPoint)
{
_touchAnchor = contactPoint;
}
bool ControlInteractivity::PointerMoved(const uint32_t /*pointerId*/,
Control::MouseButtonState buttonState,
bool ControlInteractivity::PointerMoved(Control::MouseButtonState buttonState,
const unsigned int pointerUpdateKind,
const ::Microsoft::Terminal::Core::ControlKeyStates modifiers,
const Core::Point pixelPosition)
const bool focused,
const Core::Point pixelPosition,
const bool pointerPressedInBounds)
{
const auto terminalPosition = _getTerminalPosition(til::point{ pixelPosition }, false);
// Returning true from this function indicates that the caller should do no further processing of this movement.
bool handledCompletely = false;
// Short-circuit isReadOnly check to avoid warning dialog
if (_focused && !_core->IsInReadOnlyMode() && _canSendVTMouseInput(modifiers))
if (focused && !_core->IsInReadOnlyMode() && _canSendVTMouseInput(modifiers))
{
_sendMouseEventHelper(terminalPosition, pointerUpdateKind, modifiers, 0, buttonState);
handledCompletely = true;
@@ -391,7 +353,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// actually start _in_ the control bounds. Case in point - someone drags
// a file into the bounds of the control. That shouldn't send the
// selection into space.
else if (_focused && _pointerPressedInBounds && WI_IsFlagSet(buttonState, MouseButtonState::IsLeftButtonDown))
else if (focused && pointerPressedInBounds && WI_IsFlagSet(buttonState, MouseButtonState::IsLeftButtonDown))
{
if (_singleClickTouchdownPos)
{
@@ -437,9 +399,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return handledCompletely;
}
void ControlInteractivity::TouchMoved(const Core::Point newTouchPoint)
void ControlInteractivity::TouchMoved(const winrt::Windows::Foundation::Point newTouchPoint,
const bool focused)
{
if (_focused &&
if (focused &&
_touchAnchor)
{
const auto anchor = _touchAnchor.value();
@@ -473,14 +436,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
}
void ControlInteractivity::PointerReleased(const uint32_t /*pointerId*/,
Control::MouseButtonState buttonState,
void ControlInteractivity::PointerReleased(Control::MouseButtonState buttonState,
const unsigned int pointerUpdateKind,
const ::Microsoft::Terminal::Core::ControlKeyStates modifiers,
const Core::Point pixelPosition)
{
_pointerPressedInBounds = false;
const auto terminalPosition = _getTerminalPosition(til::point{ pixelPosition }, false);
// Short-circuit isReadOnly check to avoid warning dialog
if (!_core->IsInReadOnlyMode() && _canSendVTMouseInput(modifiers))
@@ -722,9 +682,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// - cursorPosition: in pixels, relative to the origin of the control
void ControlInteractivity::SetEndSelectionPoint(const Core::Point pixelPosition)
{
// Don't round in VT mouse mode; cell-level precision matters more
const auto round = !_core->IsVtMouseModeEnabled();
_core->SetEndSelectionPoint(_getTerminalPosition(til::point{ pixelPosition }, round));
_core->SetEndSelectionPoint(_getTerminalPosition(til::point{ pixelPosition }, true));
_selectionNeedsToBeCopied = true;
}

View File

@@ -51,23 +51,23 @@ namespace winrt::Microsoft::Terminal::Control::implementation
::Microsoft::Console::Render::IRenderData* GetRenderData() const;
#pragma region Input Methods
void PointerPressed(const uint32_t pointerId,
Control::MouseButtonState buttonState,
void PointerPressed(Control::MouseButtonState buttonState,
const unsigned int pointerUpdateKind,
const uint64_t timestamp,
const ::Microsoft::Terminal::Core::ControlKeyStates modifiers,
const Core::Point pixelPosition);
void TouchPressed(const Core::Point contactPoint);
void TouchPressed(const winrt::Windows::Foundation::Point contactPoint);
bool PointerMoved(const uint32_t pointerId,
Control::MouseButtonState buttonState,
bool PointerMoved(Control::MouseButtonState buttonState,
const unsigned int pointerUpdateKind,
const ::Microsoft::Terminal::Core::ControlKeyStates modifiers,
const Core::Point pixelPosition);
void TouchMoved(const Core::Point newTouchPoint);
const bool focused,
const Core::Point pixelPosition,
const bool pointerPressedInBounds);
void TouchMoved(const winrt::Windows::Foundation::Point newTouchPoint,
const bool focused);
void PointerReleased(const uint32_t pointerId,
Control::MouseButtonState buttonState,
void PointerReleased(Control::MouseButtonState buttonState,
const unsigned int pointerUpdateKind,
const ::Microsoft::Terminal::Core::ControlKeyStates modifiers,
const Core::Point pixelPosition);
@@ -115,7 +115,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// If this is set, then we assume we are in the middle of panning the
// viewport via touch input.
std::optional<Core::Point> _touchAnchor;
std::optional<winrt::Windows::Foundation::Point> _touchAnchor;
using Timestamp = uint64_t;
@@ -142,9 +142,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
uint64_t _id;
static std::atomic<uint64_t> _nextId;
bool _focused{ false };
bool _pointerPressedInBounds{ false };
unsigned int _numberOfClicks(Core::Point clickPos, Timestamp clickTime);
void _updateSystemParameterSettings() noexcept;

View File

@@ -36,24 +36,24 @@ namespace Microsoft.Terminal.Control
void RequestPasteTextFromClipboard();
void SetEndSelectionPoint(Microsoft.Terminal.Core.Point point);
void PointerPressed(UInt32 pointerId,
MouseButtonState buttonState,
void PointerPressed(MouseButtonState buttonState,
UInt32 pointerUpdateKind,
UInt64 timestamp,
Microsoft.Terminal.Core.ControlKeyStates modifiers,
Microsoft.Terminal.Core.Point pixelPosition);
void TouchPressed(Microsoft.Terminal.Core.Point contactPoint);
void TouchPressed(Windows.Foundation.Point contactPoint);
Boolean PointerMoved(UInt32 pointerId,
MouseButtonState buttonState,
Boolean PointerMoved(MouseButtonState buttonState,
UInt32 pointerUpdateKind,
Microsoft.Terminal.Core.ControlKeyStates modifiers,
Microsoft.Terminal.Core.Point pixelPosition);
Boolean focused,
Microsoft.Terminal.Core.Point pixelPosition,
Boolean pointerPressedInBounds);
void TouchMoved(Microsoft.Terminal.Core.Point newTouchPoint);
void TouchMoved(Windows.Foundation.Point newTouchPoint,
Boolean focused);
void PointerReleased(UInt32 pointerId,
MouseButtonState buttonState,
void PointerReleased(MouseButtonState buttonState,
UInt32 pointerUpdateKind,
Microsoft.Terminal.Core.ControlKeyStates modifiers,
Microsoft.Terminal.Core.Point pixelPosition);

View File

@@ -20,7 +20,6 @@
#include "CharSentEventArgs.g.h"
#include "StringSentEventArgs.g.h"
#include "SearchMissingCommandEventArgs.g.h"
#include "ShowNotificationEventArgs.g.h"
#include "WindowSizeChangedEventArgs.g.h"
namespace winrt::Microsoft::Terminal::Control::implementation
@@ -253,17 +252,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
til::property<til::CoordType> BufferRow;
};
struct ShowNotificationEventArgs : public ShowNotificationEventArgsT<ShowNotificationEventArgs>
{
public:
ShowNotificationEventArgs(const winrt::hstring& title, const winrt::hstring& body) :
Title(title),
Body(body) {}
til::property<winrt::hstring> Title;
til::property<winrt::hstring> Body;
};
struct WindowSizeChangedEventArgs : public WindowSizeChangedEventArgsT<WindowSizeChangedEventArgs>
{
public:

View File

@@ -26,12 +26,6 @@ namespace Microsoft.Terminal.Control
Console,
};
enum AmbiguousWidth
{
Narrow,
Wide,
};
enum DefaultInputScope
{
Default,
@@ -160,12 +154,6 @@ namespace Microsoft.Terminal.Control
Int32 BufferRow { get; };
}
runtimeclass ShowNotificationEventArgs
{
String Title { get; };
String Body { get; };
}
runtimeclass WindowSizeChangedEventArgs
{
Int32 Width;

View File

@@ -29,23 +29,6 @@ namespace Microsoft.Terminal.Control
MinGW,
};
[flags]
enum OutputNotificationStyle
{
Taskbar = 0x1,
Audible = 0x2,
Tab = 0x4,
Notification = 0x8,
All = 0xffffffff
};
enum AutoDetectRunningCommand
{
Disabled,
Automatic,
Progress
};
// Class Description:
// TerminalSettings encapsulates all settings that control the
// TermControl's behavior. In these settings there is both the entirety
@@ -85,7 +68,6 @@ namespace Microsoft.Terminal.Control
Boolean DisablePartialInvalidation { get; };
Boolean SoftwareRendering { get; };
Microsoft.Terminal.Control.TextMeasurement TextMeasurement { get; };
Microsoft.Terminal.Control.AmbiguousWidth AmbiguousWidth { get; };
Microsoft.Terminal.Control.DefaultInputScope DefaultInputScope { get; };
Boolean ShowMarks { get; };
Boolean UseBackgroundImageForWindow { get; };
@@ -93,11 +75,6 @@ namespace Microsoft.Terminal.Control
Boolean RepositionCursorWithMouse { get; };
PathTranslationStyle PathTranslationStyle { get; };
String DragDropDelimiter { get; };
OutputNotificationStyle NotifyOnInactiveOutput { get; };
OutputNotificationStyle NotifyOnNextPrompt { get; };
AutoDetectRunningCommand AutoDetectRunningCommand { get; };
// NOTE! When adding something here, make sure to update ControlProperties.h too!
};

View File

@@ -60,5 +60,7 @@ namespace Microsoft.Terminal.Control
void SelectOutput(Boolean goUp);
IVector<ScrollMark> ScrollMarks { get; };
String CurrentWorkingDirectory { get; };
};
}

View File

@@ -49,10 +49,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void InteractivityAutomationPeer::ParentProvider(AutomationPeer parentProvider)
{
// LOAD-BEARING: use _parentProvider->ProviderFromPeer(_parentProvider) instead of this->ProviderFromPeer(*this).
// Since we split the automation peer into TermControlAutomationPeer and InteractivityAutomationPeer,
// using "this" returns null. This can cause issues with some UIA Client scenarios like any navigation in Narrator.
_parentProvider = parentProvider ? parentProvider.as<IAutomationPeerProtected>().ProviderFromPeer(parentProvider) : nullptr;
_parentProvider = parentProvider;
}
// Method Description:
@@ -184,11 +181,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
XamlAutomation::ITextRangeProvider InteractivityAutomationPeer::_CreateXamlUiaTextRange(UIA::ITextRangeProvider* returnVal) const
{
if (!_parentProvider)
// LOAD-BEARING: use _parentProvider->ProviderFromPeer(_parentProvider) instead of this->ProviderFromPeer(*this).
// Since we split the automation peer into TermControlAutomationPeer and InteractivityAutomationPeer,
// using "this" returns null. This can cause issues with some UIA Client scenarios like any navigation in Narrator.
const auto parent{ _parentProvider.get() };
if (!parent)
{
return nullptr;
}
const auto xutr = winrt::make_self<XamlUiaTextRange>(returnVal, _parentProvider);
const auto xutr = winrt::make_self<XamlUiaTextRange>(returnVal, parent.as<IAutomationPeerProtected>().ProviderFromPeer(parent));
return xutr.as<XamlAutomation::ITextRangeProvider>();
};
@@ -200,24 +201,22 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// - com_array of Xaml Wrapped UiaTextRange (ITextRangeProviders)
com_array<XamlAutomation::ITextRangeProvider> InteractivityAutomationPeer::WrapArrayOfTextRangeProviders(SAFEARRAY* textRanges)
{
if (!_parentProvider)
{
return {};
}
// transfer ownership of UiaTextRanges to this new vector
auto providers = SafeArrayToOwningVector<::Microsoft::Terminal::TermControlUiaTextRange>(textRanges);
const auto len = gsl::narrow<uint32_t>(providers.size());
com_array<XamlAutomation::ITextRangeProvider> result{ len };
auto count = gsl::narrow<int>(providers.size());
for (uint32_t i = 0; i < len; ++i)
std::vector<XamlAutomation::ITextRangeProvider> vec;
vec.reserve(count);
for (auto i = 0; i < count; i++)
{
if (auto xutr = _CreateXamlUiaTextRange(providers[i].detach()))
{
result[i] = std::move(xutr);
vec.emplace_back(std::move(xutr));
}
}
com_array<XamlAutomation::ITextRangeProvider> result{ vec };
return result;
}
}

View File

@@ -80,7 +80,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
::Microsoft::WRL::ComPtr<::Microsoft::Terminal::TermControlUiaProvider> _uiaProvider;
winrt::Microsoft::Terminal::Control::implementation::ControlInteractivity* _interactivity;
winrt::Windows::UI::Xaml::Automation::Provider::IRawElementProviderSimple _parentProvider{ nullptr };
weak_ref<Windows::UI::Xaml::Automation::Peers::AutomationPeer> _parentProvider;
til::rect _controlBounds{};
til::rect _controlPadding{};

View File

@@ -3,7 +3,7 @@
namespace Microsoft.Terminal.Control
{
[default_interface] runtimeclass InteractivityAutomationPeer :
Windows.UI.Xaml.Automation.Peers.FrameworkElementAutomationPeer,
Windows.UI.Xaml.Automation.Peers.AutomationPeer,
Windows.UI.Xaml.Automation.Provider.ITextProvider
{

Some files were not shown because too many files have changed in this diff Show More