mirror of
https://github.com/microsoft/terminal.git
synced 2026-05-20 22:06:56 +00:00
Compare commits
43 Commits
v1.24.1132
...
dev/lhecke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e405309bd0 | ||
|
|
7f6ab5520e | ||
|
|
84cc3e3e52 | ||
|
|
819987c90e | ||
|
|
b62cad640b | ||
|
|
9d7ea77cc8 | ||
|
|
6a8b2d10f0 | ||
|
|
04676bd31a | ||
|
|
fc2d107897 | ||
|
|
998ab586e1 | ||
|
|
10ef1284d4 | ||
|
|
5976de1600 | ||
|
|
52f9bd6d2c | ||
|
|
05a4afcf35 | ||
|
|
ad6473d6ae | ||
|
|
6b428577b9 | ||
|
|
4600c4791b | ||
|
|
e80aadd98b | ||
|
|
1926c4601c | ||
|
|
46b9572e60 | ||
|
|
0aee174e68 | ||
|
|
814f78ed2c | ||
|
|
eb16eb26ab | ||
|
|
384932183f | ||
|
|
5a05f82f7c | ||
|
|
d6714f3ca9 | ||
|
|
4a34a76504 | ||
|
|
54aaa4a98a | ||
|
|
13ddefa635 | ||
|
|
f6303ac1ae | ||
|
|
52e60b95e4 | ||
|
|
fa09141a16 | ||
|
|
8011f3e28c | ||
|
|
8d41ace320 | ||
|
|
7849b00cbd | ||
|
|
5899343237 | ||
|
|
1283c0f5b9 | ||
|
|
4272151adc | ||
|
|
bd14f69080 | ||
|
|
91c9a14a71 | ||
|
|
9e10436a80 | ||
|
|
a9b660cc36 | ||
|
|
7b754e3d8e |
6
.github/actions/spelling/expect/expect.txt
vendored
6
.github/actions/spelling/expect/expect.txt
vendored
@@ -807,6 +807,7 @@ IMPEXP
|
||||
inbox
|
||||
inclusivity
|
||||
INCONTEXT
|
||||
INDEXID
|
||||
INFOEX
|
||||
inheritcursor
|
||||
INITCOMMONCONTROLSEX
|
||||
@@ -908,6 +909,7 @@ LNM
|
||||
LOADONCALL
|
||||
LOBYTE
|
||||
localappdata
|
||||
LOCATIONCHANGE
|
||||
locsrc
|
||||
Loewen
|
||||
LOGBRUSH
|
||||
@@ -1033,6 +1035,7 @@ MOUSEACTIVATE
|
||||
MOUSEFIRST
|
||||
MOUSEHWHEEL
|
||||
MOVESTART
|
||||
msaa
|
||||
msb
|
||||
msbuildcache
|
||||
msctls
|
||||
@@ -1585,6 +1588,7 @@ SLGP
|
||||
SLIST
|
||||
slmult
|
||||
sln
|
||||
slnx
|
||||
slpit
|
||||
SManifest
|
||||
SMARTQUOTE
|
||||
@@ -1972,8 +1976,8 @@ WRITECONSOLEINPUT
|
||||
WRITECONSOLEOUTPUT
|
||||
WRITECONSOLEOUTPUTSTRING
|
||||
wrkstr
|
||||
WRL
|
||||
wrl
|
||||
WRL
|
||||
wrp
|
||||
WRunoff
|
||||
WSLENV
|
||||
|
||||
2339
OpenConsole.sln
2339
OpenConsole.sln
File diff suppressed because it is too large
Load Diff
1070
OpenConsole.slnx
Normal file
1070
OpenConsole.slnx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -375,7 +375,7 @@ winget configure .config\configuration.winget
|
||||
|
||||
## Building the Code
|
||||
|
||||
OpenConsole.sln may be built from within Visual Studio or from the command-line
|
||||
OpenConsole.slnx may be built from within Visual Studio or from the command-line
|
||||
using a set of convenience scripts & tools in the **/tools** directory:
|
||||
|
||||
### Building in PowerShell
|
||||
|
||||
@@ -56,11 +56,11 @@ Dies ist ein Open Source-Projekt, und wir freuen uns über die Teilnahme der Com
|
||||
<ReleaseNotes>
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
- Wir haben der Benutzeroberfläche durchschnittliche 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 zurückgesetzt, um die Zuverlässigkeit zu verbessern; Melden Sie alle Fehler, die mit dem alias "wt.exe" auftreten.
|
||||
- Profile zeigen jetzt ein Symbol an, wenn sie ausgeblendet wurden oder auf programme verweisen, die deinstalliert wurden.
|
||||
– 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 Details finden Sie auf unserer GitHub-Releasesseite.
|
||||
Weitere Informationen finden Sie auf unserer GitHub-Releaseseite.
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,11 +56,11 @@ Este es un proyecto de fuente abierta y animamos a la comunidad a participar. Pa
|
||||
<ReleaseNotes>
|
||||
Versión __VERSION_NUMBER__
|
||||
|
||||
- Hemos agregado decenas de configuraciones a la interfaz de usuario que solo existían una vez en el archivo JSON, incluida una página nueva para personalizar el diseño del menú Nueva pestaña.
|
||||
- Tenemos administración de ventanas rearchitecdas para mejorar la confiabilidad; envíe los errores que encuentre con el alias de wt.exe.
|
||||
- Ahora, los perfiles muestran un icono si se han ocultado o hacen referencia a programas que se han desinstalado.
|
||||
- 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
|
||||
|
||||
Consulte nuestra página de versiones de GitHub para obtener más detalles.
|
||||
Consulta la página de versiones de GitHub para más información.
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -54,13 +54,13 @@ Il s’agit d’un projet open source et nous vous invitons à participer dans l
|
||||
|
||||
</DevStudio>
|
||||
<ReleaseNotes>
|
||||
__VERSION_NUMBER__ de version
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
- Nous avons ajouté des milliers de paramètres à l’interface utilisateur qui n’existaient auparavant que dans le fichier JSON, y compris une nouvelle page pour personnaliser la disposition de votre menu Nouvel onglet !
|
||||
- Nous avons réarchitialiser la gestion des fenêtres pour améliorer la fiabilité ; entrez les bogues rencontrés avec l’alias wt.exe
|
||||
- Les profils affichent désormais une icône s’ils ont été masqués ou s’ils font référence à des programmes qui ont été désinstallés.
|
||||
- Une toute nouvelle page Extensions qui montre ce qui a été installé dans votre terminal
|
||||
- La palette de commandes s’affiche désormais dans votre langue native, ainsi qu’en 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
|
||||
|
||||
Pour plus d’informations, consultez notre page des mises en production GitHub.
|
||||
Veuillez consulter notre page des versions GitHub pour découvrir d’autres détails.
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -54,13 +54,13 @@ Si tratta di un progetto open source e la partecipazione della community è molt
|
||||
|
||||
</DevStudio>
|
||||
<ReleaseNotes>
|
||||
Versione __VERSION_NUMBER__
|
||||
Versione __VERSION_NUMBER__
|
||||
|
||||
- Sono state aggiunte decine di impostazioni all'interfaccia utente che una volta esisteva solo nel file JSON, inclusa una nuova pagina per personalizzare il layout del menu Nuova scheda.
|
||||
- È stata riattivata la gestione delle finestre per migliorare l'affidabilità; inserire eventuali bug riscontrati con l'alias wt.exe
|
||||
- I profili ora mostrano un'icona se sono stati nascosti o fanno riferimento ai programmi che sono stati disinstallati.
|
||||
- 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, vedere la pagina delle versioni di GitHub.
|
||||
Per altri dettagli, vedi la pagina delle release di GitHub.
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,11 +56,11 @@
|
||||
<ReleaseNotes>
|
||||
バージョン __VERSION_NUMBER__
|
||||
|
||||
- [新しいタブ] メニューのレイアウトをカスタマイズするための新しいページを含む、一度だけ JSON ファイルに存在した UI に多数の設定を追加しました。
|
||||
- 信頼性を向上させるためにウィンドウ管理を再選択しました。wt.exe エイリアスで発生したバグを報告してください
|
||||
- プロファイルが非表示になっているか、アンインストールされたプログラムを参照している場合にアイコンが表示されるようになりました。
|
||||
- ターミナルに何がインストールされているかを表示する新しい [拡張機能] ページ
|
||||
- コマンド パレットがネイティブ言語と英語で表示されるようになりました
|
||||
- 同期レンダリング、新しい配色、ズームなどのクイック マウス操作の構成などの、新しい VT 機能
|
||||
|
||||
詳細については、GitHub リリース ページを参照してください。
|
||||
詳細については、GitHub リリース ページをご覧ください。
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,9 +56,9 @@
|
||||
<ReleaseNotes>
|
||||
버전 __VERSION_NUMBER__
|
||||
|
||||
- 새 탭 메뉴의 레이아웃을 사용자 지정하기 위한 새 페이지를 포함하여 JSON 파일에 한 번만 존재했던 UI에 수천 개의 설정을 추가했습니다.
|
||||
- 안정성을 개선하기 위해 창 관리를 다시 보관했습니다. wt.exe 별칭에 발생한 버그를 제출하세요.
|
||||
- 프로필이 숨겨졌거나 제거된 프로그램을 참조하는 경우 이제 프로필에 아이콘이 표시됩니다.
|
||||
- 터미널에 설치된 항목을 보여 주는 완전히 새로운 확장 페이지
|
||||
- 명령 팔레트가 이제 영어뿐만 아니라 모국어로도 표시
|
||||
- 동기화된 렌더링, 새로운 색 구성표, 확대/축소와 같은 빠른 마우스 동작을 위한 구성 등 새로운 VT 기능이 추가
|
||||
|
||||
자세한 내용은 GitHub 릴리스 페이지를 참조하세요.
|
||||
</ReleaseNotes>
|
||||
|
||||
@@ -54,13 +54,13 @@ Este é um projeto de código aberto e a participação da comunidade é bem-vin
|
||||
|
||||
</DevStudio>
|
||||
<ReleaseNotes>
|
||||
Versão __VERSION_NUMBER__
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
- Adicionamos várias configurações à interface do usuário que só existiam no arquivo JSON, incluindo uma nova página para personalizar o layout do menu Nova Guia!
|
||||
- Temos o gerenciamento de janelas rearmado para melhorar a confiabilidade; registre todos os bugs encontrados com o wt.exe alias
|
||||
- Os perfis agora mostram um ícone se eles foram ocultos ou se referem a programas que foram desinstalados.
|
||||
– 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
|
||||
|
||||
Consulte nossa página de versões do GitHub para obter detalhes adicionais.
|
||||
Confira nossa página de lançamentos no GitHub para obter mais detalhes.
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,11 +56,11 @@
|
||||
<ReleaseNotes>
|
||||
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
|
||||
|
||||
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
|
||||
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
|
||||
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
|
||||
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
|
||||
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,11 +56,11 @@
|
||||
<ReleaseNotes>
|
||||
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
|
||||
|
||||
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
|
||||
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
|
||||
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
|
||||
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
|
||||
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,11 +56,11 @@
|
||||
<ReleaseNotes>
|
||||
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
|
||||
|
||||
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
|
||||
- Ą ωћόĺé ņέш ∑×τзńşĩōиŝ ρâģε τђат šнòωş ωħąт нǻś ъеēñ įηšтǻľĺéδ ĭʼnтο ўбμŗ Ţзřmĭňāŀ !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- €όммаήδ Рдĺēтţĕ пŏẅ şĥŏшś üρ ϊñ ỳоũѓ йαťïνє ļäŋģµаġέ άś ŵєŀľ åś Σиĝℓĭŝђ !!! !!! !!! !!! !!! !!! !!!
|
||||
- ∏еẅ VΤ ƒэåŧύґέŝ şűçн ăŝ ѕỳňсĥŗǿйìźėð гēŋďзříⁿğ, ηĕш ćôĺõг şĉћěмєѕ, çóńƒіĝџŗáτїöπ ƒοг qũī¢ķ möűšë ąćŧϊόņŝ ľîķє žøōmίйğ, ǻⁿđ мόřε !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
|
||||
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
|
||||
Ρĺęąŝэ ѕєě õμя ĞĭтΗύв řєĺэдšέŝ рάġě ƒοґ àďđϊтїõлаℓ ðêţǻїłş. !!! !!! !!! !!! !!! !!!
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,9 +56,9 @@
|
||||
<ReleaseNotes>
|
||||
Версия __VERSION_NUMBER__
|
||||
|
||||
- Мы добавили в пользовательский интерфейс десятки параметров, которые существовали только в JSON-файле, включая новую страницу для настройки макета меню "Новая вкладка".
|
||||
- Для повышения надежности мы переупоряхлили управление окнами; создайте все ошибки, обнаруженные с wt.exe псевдонимом
|
||||
- Профили теперь показывают значок, если они скрыты или ссылаются на программы, которые были удалены.
|
||||
– Новая страница расширений, на которой отображается информация о том, что было установлено в вашем терминале
|
||||
– Палитра команд теперь доступна на вашем языке, а также на английском
|
||||
– Новые функции VT, например синхронизированная отрисовка, новые цветовые схемы, настройка быстрых действий мыши, таких как масштабирование, и т. д.
|
||||
|
||||
Дополнительные сведения см. на странице выпусков GitHub.
|
||||
</ReleaseNotes>
|
||||
|
||||
@@ -54,13 +54,13 @@
|
||||
|
||||
</DevStudio>
|
||||
<ReleaseNotes>
|
||||
版本 __VERSION_NUMBER__
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
- 我们向用户界面添加了许多设置,这些设置仅存在于 JSON 文件中,包括用于自定义“新建标签页”菜单布局的新页面!
|
||||
- 我们已重新检测窗口管理以提高可靠性;请将遇到的任何 bug 归档为 wt.exe 别名
|
||||
- 如果配置文件已隐藏或引用已卸载的程序,则它们现在将显示一个图标。
|
||||
- 一个全新的“扩展”页,显示已安装到终端的内容
|
||||
- 命令面板现在以你的母语和英语显示
|
||||
- 新的 VT 功能,例如同步渲染、新配色方案、快速鼠标操作(如缩放)的配置等
|
||||
|
||||
有关其他详细信息,请参阅 GitHub 发布页面。
|
||||
有关其他详细信息,请参阅我们的 GitHub 发布页面。
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -54,13 +54,13 @@
|
||||
|
||||
</DevStudio>
|
||||
<ReleaseNotes>
|
||||
版本 __VERSION_NUMBER__
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
- 我們已新增數十個只存在於 JSON 檔案中的設定到 UI,包括自定義 [新索引標籤] 功能表版面配置的新頁面!
|
||||
- 我們已重新設定視窗管理,以改善可靠性;請提出您在 wt.exe 別名遇到的任何錯誤
|
||||
- 設定文件現在會在隱藏或參照已卸載的程式時顯示圖示。
|
||||
- 全新的延伸模組頁面會顯示已安裝在您終端機中的內容
|
||||
- 命令選擇區現在以您的母語和英文顯示
|
||||
- 新的 VT 功能,例如同步轉譯、新的色彩配置、快速滑鼠動作 (例如縮放) 設定等等
|
||||
|
||||
如需詳細數據,請參閱我們的 GitHub 版本頁面。
|
||||
如需更多詳細資料,請參閱我們的 GitHub 發行版本頁面。
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"DisableAutoPackageNameFormatting": false
|
||||
},
|
||||
"appSubmission": {
|
||||
"appId": "9N8G5RFZ9XK3",
|
||||
"productId": "00014050269303149694",
|
||||
"targetPublishMode": "NotSet",
|
||||
"targetPublishDate": null,
|
||||
|
||||
@@ -56,12 +56,9 @@ Dies ist ein Open Source-Projekt, und wir freuen uns über die Teilnahme an der
|
||||
<ReleaseNotes>
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
– Wir haben umgeschrieben, wie Konsolenanwendungen im Terminal gehostet werden! Melden Sie alle auftretenden Fehler.
|
||||
– Terminal unterstützt jetzt Sixels!
|
||||
– Sie können jetzt einen angedockten Bereich öffnen, der Ausschnitte von Befehlen enthält, die Sie gespeichert haben, um sie später zu verwenden.
|
||||
– Für Benutzer der Eingabeaufforderung der neuesten Version von Windows 11 wird möglicherweise ein QuickInfo-Symbol angezeigt, das installierbare Software von WinGet vorschlägt.
|
||||
– Ausgewählter Text wird jetzt viel sichtbarer (und anpassbarer!).
|
||||
- Eine Reihe von Zuverlässigkeitsfehlern, Benutzerfreundlichkeitsproblemen und Ärgernissen wurden behoben.
|
||||
– 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>
|
||||
|
||||
@@ -56,12 +56,9 @@ Este es un proyecto de fuente abierta y animamos a la comunidad a participar. Pa
|
||||
<ReleaseNotes>
|
||||
Versión __VERSION_NUMBER__
|
||||
|
||||
- Hemos reescrito cómo se hospedan las aplicaciones de consola en Terminal. Informe de los errores que encuentre.
|
||||
- Terminal ahora admite síxeles.
|
||||
- Ahora puede abrir un panel acoplado que contenga fragmentos de comandos que haya guardado para usarlos más adelante
|
||||
- Los usuarios del símbolo del sistema de la versión más reciente de Windows 11 pueden ver un icono de "sugerencia rápida" que sugiere software instalable de WinGet
|
||||
- El texto seleccionado ahora será mucho más visible (y personalizable)
|
||||
- Se han corregido varios errores de fiabilidad, problemas de comodidad y molestias.
|
||||
- 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>
|
||||
|
||||
@@ -56,12 +56,9 @@ Il s’agit d’un projet open source et nous encourageons la participation à l
|
||||
<ReleaseNotes>
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
– Nous avons réécrit la manière dont les applications de console sont hébergées dans Terminal ! Veuillez signaler tout bogue que vous rencontrez.
|
||||
– Terminal prend désormais en charge Sixels !
|
||||
– Vous pouvez maintenant ouvrir un panneau ancré contenant des extraits de commandes que vous avez enregistrées pour les utiliser ultérieurement
|
||||
– Les utilisateurs de l’invite de commande sur la dernière version de Windows 11 peuvent voir une icône « astuce rapide » qui suggère un logiciel installable à partir de WinGet
|
||||
– Le texte sélectionné sera désormais beaucoup plus visible (et personnalisable !)
|
||||
– Un certain nombre de bogues de fiabilité, de problèmes de commodité et de désagréments ont été corrigés.
|
||||
- Nous avons ajouté des dizaines de paramètres à l’interface utilisateur qui n’existaient 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 l’alias wt.exe.
|
||||
- Les profils affichent désormais une icône s’ils ont été masqués ou s’ils font référence à des programmes qui ont été désinstallés.
|
||||
|
||||
Veuillez consulter notre page des versions GitHub pour découvrir d’autres détails.
|
||||
</ReleaseNotes>
|
||||
|
||||
@@ -56,12 +56,9 @@ Si tratta di un progetto open source e la partecipazione della community è molt
|
||||
<ReleaseNotes>
|
||||
Versione __VERSION_NUMBER__
|
||||
|
||||
- Abbiamo cambiato il modo in cui le applicazioni della console vengono ospitate all’interno di Terminale. Segnala eventuali bug riscontrati.
|
||||
- Ora Terminale supporta i Sixel.
|
||||
- Puoi aprire un pannello ancorato contenente frammenti di comandi salvati per usarli in seguito
|
||||
- Gli utenti che usano il prompt dei comandi nella versione più recente di Windows 11 potrebbero visualizzare un’icona di “suggerimento rapido” che consiglia il software installabile da WinGet
|
||||
- Il testo selezionato sarà ora molto più visibile, oltre che personalizzabile.
|
||||
- Sono stati risolti diversi bug di affidabilità e problemi di ordine pratico.
|
||||
- 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>
|
||||
|
||||
@@ -56,12 +56,9 @@
|
||||
<ReleaseNotes>
|
||||
バージョン __VERSION_NUMBER__
|
||||
|
||||
- ターミナル内でのコンソール アプリケーションのホスト方法を書き換えました。発生したバグを報告してください。
|
||||
- ターミナルで Sixels がサポートされるようになりました。
|
||||
- 後で使用するために保存したコマンドのスニペットを含むドッキング パネルを開けるようになりました
|
||||
- 最新の Windows 11 リリースのコマンド プロンプト ユーザーには、WinGet からインストール可能なソフトウェアを提案する "クイック ヒント" アイコンが表示される場合があります
|
||||
- 選択したテキストが大幅に見やすくなりました (カスタマイズも可能です)
|
||||
- 信頼性に関するバグ、利便性の問題、不快な問題の多くが修正されました。
|
||||
- 新しいタブ メニューのレイアウトをカスタマイズするための新しいページなど、以前は JSON ファイルにしかなかった設定が UI に多数追加されました。
|
||||
- 信頼性を向上させるために、ウィンドウ管理を再設計しました。wt.exe エイリアスで発生したバグを報告してください
|
||||
- プロファイルが非表示になっている場合や、アンインストールされたプログラムを参照している場合に、アイコンが表示されるようになりました。
|
||||
|
||||
詳細については、GitHub リリース ページをご覧ください。
|
||||
</ReleaseNotes>
|
||||
|
||||
@@ -56,12 +56,9 @@
|
||||
<ReleaseNotes>
|
||||
버전 __VERSION_NUMBER__
|
||||
|
||||
- 콘솔 애플리케이션이 터미널 내에서 호스팅되는 방법을 다시 작성했습니다. 버그가 발생하면 보고해 주세요.
|
||||
- 터미널에서 이제 Sixels를 지원합니다.
|
||||
- 이제 나중에 사용하기 위해 저장한 명령 조각이 포함된 도킹된 패널을 열 수 있습니다.
|
||||
- 최신 Windows 11 릴리스의 명령 프롬프트 사용자는 WinGet에서 설치 가능한 소프트웨어를 추천하는 "간단한 팁" 아이콘을 볼 수 있습니다.
|
||||
- 이제 선택한 텍스트가 훨씬 더 잘 보입니다(사용자 지정 가능).
|
||||
- 여러 안정성 버그, 편의성 문제, 불편 사항이 수정되었습니다.
|
||||
- 새 탭 메뉴의 레이아웃을 사용자 지정하기 위한 새 페이지를 포함하여 JSON 파일에만 존재했던 수십 개의 설정을 UI에 추가
|
||||
- 안정성을 개선하기 위해 창 관리 구조를 재구성했습니다. wt.exe 별칭과 관련하여 발생한 버그 신고
|
||||
- 프로필이 숨겨졌거나 제거된 프로그램을 참조하는 경우 이제 프로필에 아이콘이 표시됩니다.
|
||||
|
||||
자세한 내용은 GitHub 릴리스 페이지를 참조하세요.
|
||||
</ReleaseNotes>
|
||||
|
||||
@@ -54,14 +54,11 @@ Este é um projeto de código aberto e a participação da comunidade é bem-vin
|
||||
|
||||
</DevStudio>
|
||||
<ReleaseNotes>
|
||||
Versão __VERSION_NUMBER__
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
– Reescrevemos a forma como os aplicativos de console são hospedados no Terminal! Relate os bugs encontrados.
|
||||
– O terminal agora oferece suporte ao Sixels!
|
||||
– Agora você pode abrir um painel acoplado contendo snippets de comandos que você salvou para usar mais tarde
|
||||
– Os usuários do Prompt de Comando na versão mais recente do Windows 11 podem ver um ícone de "dica rápida", que sugere softwares instaláveis a partir do WinGet
|
||||
– O texto selecionado agora ficará muito mais visível (e personalizável!)
|
||||
– Vários bugs de confiabilidade, problemas de conveniência e incômodos foram resolvidos.
|
||||
– 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>
|
||||
|
||||
@@ -56,14 +56,11 @@
|
||||
<ReleaseNotes>
|
||||
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
|
||||
|
||||
- Ẁē'νё ŕéẁѓĭτťёñ ћοώ ĉòπşõℓε άррℓіċªťįõпѕ αяе ĥθѕťэđ įŋšιďé Ţєямїńąℓ! Рļéаšė яёροřτ αņу ьϋģš ýõμ éпćŏџήţęя. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!
|
||||
- Ţëямΐʼnαļ ńóẃ ŝüррöятš Śїхέłś! !!! !!! !!!
|
||||
- ¥оų ĉåи ńòŵ θρėñ д đбčĸэď ράńέļ ċőлŧăīņϊňģ śⁿіφφëťś оƒ ςōмmàⁿďş ŷŏũ ĥªν℮ şåνěđ τσ üśε łαťэŗ !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ćοмmäлđ Рřōmφť üş℮ŗѕ öη τће ļāťëšτ Щīйđôώѕ 11 řёℓеаѕĕ måў ŝэε ά "qůïςκ ŧĭр" ιсôñ τĥдт šűğģєѕŧѕ ίńśŧăłłавļз šôƒţẁαгέ ƒґόm ЩĩйĞéţ !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Śєļèċťєď ţĕжт ωϊŀļ йǿẃ ьέ mџ¢н мǿѓε νĭŝϊъļė (άŋđ сŭŝтŏмΐżдьļē!) !!! !!! !!! !!! !!! !!! !
|
||||
- Ä ņϋmъ℮ŗ ŏƒ ѓēŀїаъïļŧÿ ьüĝś, ςôⁿνėηĭ℮иć℮ îѕšůëş ăπð âлňбγдňçėŝ ћªνε ъēёп ƒΐ×еð. !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
|
||||
|
||||
Ρĺёàŝ℮ ŝез ǿúг ĢīťНŭъ řěłεαśèŝ φāğ℮ ƒóѓ дďδітĭøиąℓ ð℮тªїľŝ. !!! !!! !!! !!! !!! !!!
|
||||
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,14 +56,11 @@
|
||||
<ReleaseNotes>
|
||||
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
|
||||
|
||||
- Ẁē'νё ŕéẁѓĭτťёñ ћοώ ĉòπşõℓε άррℓіċªťįõпѕ αяе ĥθѕťэđ įŋšιďé Ţєямїńąℓ! Рļéаšė яёροřτ αņу ьϋģš ýõμ éпćŏџήţęя. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!
|
||||
- Ţëямΐʼnαļ ńóẃ ŝüррöятš Śїхέłś! !!! !!! !!!
|
||||
- ¥оų ĉåи ńòŵ θρėñ д đбčĸэď ράńέļ ċőлŧăīņϊňģ śⁿіφφëťś оƒ ςōмmàⁿďş ŷŏũ ĥªν℮ şåνěđ τσ üśε łαťэŗ !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ćοмmäлđ Рřōmφť üş℮ŗѕ öη τће ļāťëšτ Щīйđôώѕ 11 řёℓеаѕĕ måў ŝэε ά "qůïςκ ŧĭр" ιсôñ τĥдт šűğģєѕŧѕ ίńśŧăłłавļз šôƒţẁαгέ ƒґόm ЩĩйĞéţ !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Śєļèċťєď ţĕжт ωϊŀļ йǿẃ ьέ mџ¢н мǿѓε νĭŝϊъļė (άŋđ сŭŝтŏмΐżдьļē!) !!! !!! !!! !!! !!! !!! !
|
||||
- Ä ņϋmъ℮ŗ ŏƒ ѓēŀїаъïļŧÿ ьüĝś, ςôⁿνėηĭ℮иć℮ îѕšůëş ăπð âлňбγдňçėŝ ћªνε ъēёп ƒΐ×еð. !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
|
||||
|
||||
Ρĺёàŝ℮ ŝез ǿúг ĢīťНŭъ řěłεαśèŝ φāğ℮ ƒóѓ дďδітĭøиąℓ ð℮тªїľŝ. !!! !!! !!! !!! !!! !!!
|
||||
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,14 +56,11 @@
|
||||
<ReleaseNotes>
|
||||
Vėѓѕіöй __VERSION_NUMBER__ !!! !!! !
|
||||
|
||||
- Ẁē'νё ŕéẁѓĭτťёñ ћοώ ĉòπşõℓε άррℓіċªťįõпѕ αяе ĥθѕťэđ įŋšιďé Ţєямїńąℓ! Рļéаšė яёροřτ αņу ьϋģš ýõμ éпćŏџήţęя. !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!
|
||||
- Ţëямΐʼnαļ ńóẃ ŝüррöятš Śїхέłś! !!! !!! !!!
|
||||
- ¥оų ĉåи ńòŵ θρėñ д đбčĸэď ράńέļ ċőлŧăīņϊňģ śⁿіφφëťś оƒ ςōмmàⁿďş ŷŏũ ĥªν℮ şåνěđ τσ üśε łαťэŗ !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ćοмmäлđ Рřōmφť üş℮ŗѕ öη τће ļāťëšτ Щīйđôώѕ 11 řёℓеаѕĕ måў ŝэε ά "qůïςκ ŧĭр" ιсôñ τĥдт šűğģєѕŧѕ ίńśŧăłłавļз šôƒţẁαгέ ƒґόm ЩĩйĞéţ !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Śєļèċťєď ţĕжт ωϊŀļ йǿẃ ьέ mџ¢н мǿѓε νĭŝϊъļė (άŋđ сŭŝтŏмΐżдьļē!) !!! !!! !!! !!! !!! !!! !
|
||||
- Ä ņϋmъ℮ŗ ŏƒ ѓēŀїаъïļŧÿ ьüĝś, ςôⁿνėηĭ℮иć℮ îѕšůëş ăπð âлňбγдňçėŝ ћªνε ъēёп ƒΐ×еð. !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ẁē'νё àðđέď đöžзńş öƒ śėŧťїńģš тб тнè ÛĮ ťħąт ŏņ¢з όⁿℓγ έжіѕŧéð іή тђε ЈŠΩŃ ƒїℓė, ĭňĉŀџđіņģ å ňэẅ φâģé ƒøя ςŭśŧŏmïżϊñģ тħέ ĺαŷöυτ öƒ убµř Йέẁ Ţàъ мęήµ! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Ẁè ĥаνė řэąřčħΐŧέсτέð щįлďοш мǻňαĝēмêиť ťô ϊmрябνé ŗĕŀĩāвîĺïтγ; ρŀěăѕе ƒíŀё αⁿу вûġš ÿøú εʼnćōùлťēѓ ẃïτħ ŧћё wt.exe ǻļĭâś !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!
|
||||
- Рґøƒíŀêŝ ňöẁ šћθẁ ãй ĭčöñ ίƒ ŧħэŷ'νę ъеєл ђіðδэñ őř řєƒěґ ŧσ φяοġгаmŝ ẅђíçĥ ẁ℮гέ џňϊйşťàľĺèð. !!! !!! !!! !!! !!! !!! !!! !!! !!! !
|
||||
|
||||
Ρĺёàŝ℮ ŝез ǿúг ĢīťНŭъ řěłεαśèŝ φāğ℮ ƒóѓ дďδітĭøиąℓ ð℮тªїľŝ. !!! !!! !!! !!! !!! !!!
|
||||
Рļèāŝє ŝèĕ θџŗ ĢίťĤцъ řέĺэªşэš ρąĝę ƒόř áďđїτϊōπαľ đэŧдįļŝ. !!! !!! !!! !!! !!! !!!
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -56,12 +56,9 @@
|
||||
<ReleaseNotes>
|
||||
Версия __VERSION_NUMBER__
|
||||
|
||||
– Мы переписали, как консольные приложения размещаются внутри Терминала! Сообщайте о любых ошибках, с которыми вы столкнулись.
|
||||
– Терминал теперь поддерживает форматы Sixel!
|
||||
– Теперь вы можете открыть закрепленную панель, содержащую фрагменты команд, которые вы сохранили для использования в дальнейшем
|
||||
– Пользователи командной строки в новейшем выпуске Windows 11 могут увидеть значок "краткой подсказки", который предлагает устанавливаемые программы из WinGet
|
||||
– Выделенный текст теперь станет более видимым (и настраиваемым!)
|
||||
– Исправлено несколько ошибок надежности, проблем с удобством, а также устранены раздражающие моменты.
|
||||
– Мы добавили в пользовательский интерфейс десятки параметров, которые ранее существовали только в JSON-файле, включая новую страницу для настройки макета меню новой вкладки.
|
||||
– Мы переработали управление окнами для повышения надежности. Сообщайте о любых ошибках, которые вы обнаружите с псевдонимом wt.exe
|
||||
– Профили теперь отображают значок, если они были скрыты или ссылаются на программы, которые были удалены.
|
||||
|
||||
Дополнительные сведения см. на странице выпусков GitHub.
|
||||
</ReleaseNotes>
|
||||
|
||||
@@ -56,12 +56,9 @@
|
||||
<ReleaseNotes>
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
- 我们已改变主机应用程序在终端内的托管方式!请报告遇到的任何 bug。
|
||||
- 终端现在支持 Sixels!
|
||||
- 现在可以打开一个停靠面板,其中包含已保存供以后使用的命令片段
|
||||
- 最新 Windows 11 版本上的命令提示用户可能会看到“快速提示”图标,该图标建议从 WinGet 安装软件
|
||||
- 所选文本现在将具有更高的可见性(和可自定义性!)
|
||||
- 修复了许多可靠性 bug、便利性问题和令人烦恼的问题。
|
||||
- 我们向用户界面添加了许多之前仅存在于 JSON 文件中的设置,包括用于自定义“新建标签页”菜单布局的新页面!
|
||||
- 我们已重新架构窗口管理以提高可靠性; 请使用 wt.exe 别名提交您遇到的任何错误
|
||||
- 配置文件如果已被隐藏或引用了已卸载的程序,现在会显示一个图标。
|
||||
|
||||
有关其他详细信息,请参阅我们的 GitHub 发布页面。
|
||||
</ReleaseNotes>
|
||||
|
||||
@@ -54,16 +54,13 @@
|
||||
|
||||
</DevStudio>
|
||||
<ReleaseNotes>
|
||||
版本 __VERSION_NUMBER__
|
||||
Version __VERSION_NUMBER__
|
||||
|
||||
- 我們已重寫主機應用程式在終端機內託管的方式!請報告您遇到的錯誤。
|
||||
- 終端機現在支援 Sixels!
|
||||
- 現在,您可以開啟包含已儲存命令程式碼片段的固定面板,以供稍後使用
|
||||
- 最新 Windows 11 版本中的 [命令提示] 使用者可能會看到「快速提示」圖示,建議可自 WinGet 安裝的軟體
|
||||
- 選取的文字現在會更明顯 (且可自訂!)
|
||||
- 已修正一些可靠性錯誤、便利性問題和令人困擾的問題。
|
||||
- 我們已在使用者介面中新增數十個曾經僅存在於 JSON 檔案中的設定,包括一個可自訂新索引標籤選單版面配置的新頁面!
|
||||
- 我們已重新架構視窗管理以提升可靠性; 如果您在使用 wt.exe 別名時遇到任何錯誤,請提交錯誤回報
|
||||
- 如果設定檔已隱藏或參照已解除安裝的程式,現在會顯示圖示。
|
||||
|
||||
如需更多詳細資訊,請參閱我們的 GitHub 發行頁面。
|
||||
如需更多詳細資料,請參閱我們的 GitHub 發行版本頁面。
|
||||
</ReleaseNotes>
|
||||
<ScreenshotCaptions>
|
||||
<!-- Valid length: 200 character limit, up to 9 elements per platform -->
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"DisableAutoPackageNameFormatting": false
|
||||
},
|
||||
"appSubmission": {
|
||||
"appId": "9N0DX20HK701",
|
||||
"productId": "00013926773940052066",
|
||||
"targetPublishMode": "NotSet",
|
||||
"targetPublishDate": null,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"collection": "microsoft",
|
||||
"project": "OS",
|
||||
"repo": "os.2020",
|
||||
"name": "official/rs_we_adept_e4d2",
|
||||
"name": "official/ge_current_directwinpd_deep",
|
||||
"workitem": "38106206",
|
||||
"CheckinFiles": [
|
||||
{
|
||||
|
||||
@@ -51,8 +51,8 @@ steps:
|
||||
displayName: 'Touchdown Build - 7105, PRODEXT'
|
||||
inputs:
|
||||
teamId: 7105
|
||||
TDBuildServiceConnection: $(TouchdownServiceConnection)
|
||||
authType: SubjectNameIssuer
|
||||
FederatedIdentityTDBuildServiceConnection: $(TouchdownServiceConnection)
|
||||
authType: FederatedIdentityTDBuild
|
||||
resourceFilePath: |
|
||||
**\en-US\*.resw
|
||||
build\StoreSubmission\Stable\PDPs\en-us\PDP.xml
|
||||
|
||||
@@ -53,8 +53,12 @@ parameters:
|
||||
displayName: "Publish Symbols to MSDL"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: createVpack
|
||||
displayName: "Create a VPack for Windows"
|
||||
type: boolean
|
||||
default: false
|
||||
- name: publishVpackToWindows
|
||||
displayName: "Publish VPack to Windows"
|
||||
displayName: "Publish above VPack to Windows"
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
@@ -89,6 +93,7 @@ extends:
|
||||
clientId: $(SigningOriginalClientId)
|
||||
terminalInternalPackageVersion: ${{ parameters.terminalInternalPackageVersion }}
|
||||
publishSymbolsToPublic: ${{ parameters.publishSymbolsToPublic }}
|
||||
createVpack: ${{ parameters.createVpack }}
|
||||
publishVpackToWindows: ${{ parameters.publishVpackToWindows }}
|
||||
symbolPublishingSubscription: $(SymbolPublishingServiceConnection)
|
||||
symbolPublishingProject: $(SymbolPublishingProject)
|
||||
|
||||
@@ -75,9 +75,9 @@ jobs:
|
||||
- template: .\steps-restore-nuget.yml
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: Build solution OpenConsole.sln for WPF Control (Pack)
|
||||
displayName: Build solution OpenConsole.slnx for WPF Control (Pack)
|
||||
inputs:
|
||||
solution: 'OpenConsole.sln'
|
||||
solution: 'OpenConsole.slnx'
|
||||
msbuildArgs: >-
|
||||
/p:WindowsTerminalReleaseBuild=true;Version=$(XES_PACKAGEVERSIONNUMBER)
|
||||
/p:NoBuild=true
|
||||
|
||||
@@ -170,9 +170,9 @@ jobs:
|
||||
- ${{ parameters.beforeBuildSteps }}
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: Build OpenConsole.sln
|
||||
displayName: Build OpenConsole.slnx
|
||||
inputs:
|
||||
solution: 'OpenConsole.sln'
|
||||
solution: 'OpenConsole.slnx'
|
||||
msbuildArgs: >-
|
||||
/p:WindowsTerminalOfficialBuild=true;WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }}
|
||||
${{ parameters.additionalBuildOptions }}
|
||||
|
||||
@@ -49,6 +49,9 @@ parameters:
|
||||
- name: symbolExpiryTime
|
||||
type: string
|
||||
default: 36530 # This is the default from PublishSymbols@2
|
||||
- name: createVpack
|
||||
type: boolean
|
||||
default: false
|
||||
- name: publishVpackToWindows
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -192,8 +195,8 @@ extends:
|
||||
ob_outputDirectory: $(JobOutputDirectory)
|
||||
ob_artifactBaseName: $(JobOutputArtifactName)
|
||||
### This job is also in charge of submitting the vpack to Windows if it's enabled
|
||||
ob_createvpack_enabled: ${{ and(parameters.buildTerminal, parameters.publishVpackToWindows) }}
|
||||
ob_updateOSManifest_enabled: ${{ and(parameters.buildTerminal, parameters.publishVpackToWindows) }}
|
||||
ob_createvpack_enabled: ${{ and(parameters.buildTerminal, parameters.createVpack) }}
|
||||
ob_updateOSManifest_enabled: ${{ and(parameters.buildTerminal, parameters.createVpack, parameters.publishVpackToWindows) }}
|
||||
### If enabled above, these options are in play.
|
||||
ob_createvpack_packagename: 'WindowsTerminal.app'
|
||||
ob_createvpack_owneralias: 'conhost@microsoft.com'
|
||||
@@ -229,7 +232,7 @@ extends:
|
||||
New-Item "$(JobOutputDirectory)/vpack" -Type Directory
|
||||
displayName: Make sure the vpack directory exists
|
||||
|
||||
- ${{ if parameters.publishVpackToWindows }}:
|
||||
- ${{ if parameters.createVpack }}:
|
||||
- pwsh: |-
|
||||
Copy-Item -Verbose -Path "$(MsixBundlePath)" -Destination (Join-Path "$(JobOutputDirectory)/vpack" 'Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle')
|
||||
displayName: Stage msixbundle for vpack
|
||||
|
||||
@@ -19,14 +19,16 @@ steps:
|
||||
restoreSolution: build/packages.config
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
- task: VSBuild@1
|
||||
displayName: Restore NuGet packages for solution
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: OpenConsole.sln
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
solution: 'OpenConsole.slnx'
|
||||
msbuildArgs: /t:Restore
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for global nuget
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<XesUseOneStoreVersioning>true</XesUseOneStoreVersioning>
|
||||
<XesBaseYearForStoreVersion>2025</XesBaseYearForStoreVersion>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>24</VersionMinor>
|
||||
<VersionMinor>25</VersionMinor>
|
||||
<VersionInfoProductName>Windows Terminal</VersionInfoProductName>
|
||||
<VersionInfoCulture>1033</VersionInfoCulture>
|
||||
<!-- The default has a spacing problem -->
|
||||
|
||||
@@ -7,9 +7,17 @@ Licensed under the MIT license.
|
||||
|
||||
#include <ntcsrmsg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
NTSTATUS CsrClientCallServer(
|
||||
PCSR_API_MSG m,
|
||||
PCSR_CAPTURE_HEADER CaptureBuffer OPTIONAL,
|
||||
ULONG ApiNumber,
|
||||
ULONG ArgLength
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,10 @@ Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OB_FILE_OBJECT_TYPE 1
|
||||
|
||||
typedef struct _PORT_MESSAGE {
|
||||
@@ -124,3 +128,7 @@ NTSTATUS NtAlpcQueryInformationMessage(
|
||||
ULONG Length,
|
||||
PULONG ReturnLength
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,7 @@ This repository uses [git submodules](https://git-scm.com/book/en/v2/Git-Tools-S
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
OpenConsole.sln may be built from within Visual Studio or from the command-line using a set of convenience scripts & tools in the **/tools** directory:
|
||||
OpenConsole.slnx may be built from within Visual Studio or from the command-line using a set of convenience scripts & tools in the **/tools** directory:
|
||||
|
||||
When using Visual Studio, be sure to set up the path for code formatting. To download the required clang-format.exe file, follow one of the building instructions below and run:
|
||||
```powershell
|
||||
@@ -103,7 +103,7 @@ If you want to use .nupkg files instead of the downloaded Nuget package, you can
|
||||
The Terminal is bundled as an `.msix`, which is produced by the `CascadiaPackage.wapproj` project. To build that project from the commandline, you can run the following (from a window you've already run `tools\razzle.cmd` in):
|
||||
|
||||
```cmd
|
||||
"%msbuild%" "%OPENCON%\OpenConsole.sln" /p:Configuration=%_LAST_BUILD_CONF% /p:Platform=%ARCH% /p:AppxSymbolPackageEnabled=false /t:Terminal\CascadiaPackage /m
|
||||
"%msbuild%" "%OPENCON%\OpenConsole.slnx" /p:Configuration=%_LAST_BUILD_CONF% /p:Platform=%ARCH% /p:AppxSymbolPackageEnabled=false /t:Terminal\CascadiaPackage /m
|
||||
```
|
||||
|
||||
This takes quite some time, and only generates an `msix`. It does not install the msix. To deploy the package:
|
||||
|
||||
@@ -2302,8 +2302,15 @@
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The ID of the command this keybinding should execute.",
|
||||
"type": "string"
|
||||
"description": "The ID of the command this keybinding should execute (or null to disable a default).",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"keys": {
|
||||
"description": "Defines the key combinations used to call the command. It must be composed of...\n -any number of modifiers (ctrl/alt/shift)\n -a non-modifier key",
|
||||
@@ -2459,6 +2466,7 @@
|
||||
"description": "Direct3D 11 provides a more performant and feature-rich experience, whereas Direct2D is more stable. The default option \"Automatic\" will pick the API that best fits your graphics hardware. If you experience significant issues, consider using Direct2D.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"automatic",
|
||||
"direct2d",
|
||||
"direct3d11"
|
||||
]
|
||||
@@ -2472,8 +2480,9 @@
|
||||
"type": "boolean"
|
||||
},
|
||||
"experimental.input.forceVT": {
|
||||
"description": "Force the terminal to use the legacy input encoding. Certain keys in some applications may stop working when enabling this setting.",
|
||||
"type": "boolean"
|
||||
"type": "boolean",
|
||||
"description": "[Deprecated] Replaced with the \"compatibility.input.forceVT\" profile setting.",
|
||||
"deprecated": true
|
||||
},
|
||||
"experimental.useBackgroundImageForWindow": {
|
||||
"default": false,
|
||||
@@ -2520,14 +2529,14 @@
|
||||
"type": "string"
|
||||
},
|
||||
"rowsToScroll": {
|
||||
"default": "system",
|
||||
"description": "This parameter once allowed you to override the systemwide \"choose how many lines to scroll at one time\" setting. It no longer does so. However, you can customize the number of lines to scroll in \"scrollUp\" and \"scrollDown\" bindings.",
|
||||
"maximum": 999,
|
||||
"minimum": 0,
|
||||
"type": [
|
||||
"integer",
|
||||
"string"
|
||||
],
|
||||
"description": "[Deprecated] This setting no longer has any effect. However, you can customize the number of lines to scroll using the \"rowsToScroll\" argument on the \"scrollUp\" and \"scrollDown\" actions.",
|
||||
"default": "system",
|
||||
"minimum": 0,
|
||||
"maximum": 999,
|
||||
"deprecated": true
|
||||
},
|
||||
"minimizeToNotificationArea": {
|
||||
@@ -2573,9 +2582,12 @@
|
||||
"$ref": "#/$defs/NewTabMenu"
|
||||
},
|
||||
"language": {
|
||||
"default": "",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"description": "Sets an override for the app's preferred language, expressed as a BCP-47 language tag like en-US.",
|
||||
"type": "string"
|
||||
"default": null
|
||||
},
|
||||
"theme": {
|
||||
"default": "dark",
|
||||
@@ -2639,19 +2651,19 @@
|
||||
"type": "boolean"
|
||||
},
|
||||
"useTabSwitcher": {
|
||||
"description": "[Deprecated] Replaced with the \"tabSwitcherMode\" setting.",
|
||||
"default": true,
|
||||
"description": "Deprecated. Please use \"tabSwitcherMode\" instead.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"mru",
|
||||
"inOrder",
|
||||
"disabled"
|
||||
],
|
||||
"type": "string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"deprecated": true
|
||||
@@ -2708,12 +2720,12 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"acrylicOpacity": {
|
||||
"type": "number",
|
||||
"description": "[Deprecated] Replaced with the \"opacity\" setting.",
|
||||
"default": 0.5,
|
||||
"description": "[deprecated] Please use `opacity` instead.",
|
||||
"deprecated": true,
|
||||
"maximum": 1,
|
||||
"minimum": 0,
|
||||
"type": "number"
|
||||
"maximum": 1,
|
||||
"deprecated": true
|
||||
},
|
||||
"antialiasingMode": {
|
||||
"default": "grayscale",
|
||||
@@ -2739,6 +2751,11 @@
|
||||
"description": "When set to true, when opening a new tab or pane it will get reloaded environment variables.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"compatibility.input.forceVT": {
|
||||
"default": false,
|
||||
"description": "Force the terminal to use the legacy input encoding. Certain keys in some applications may stop working when enabling this setting.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"compatibility.allowDECRQCRA": {
|
||||
"default": false,
|
||||
"description": "When set to true, the terminal will support the DECRQCRA (Request Checksum of Rectangular Area) escape sequence.",
|
||||
@@ -2910,24 +2927,29 @@
|
||||
"type": "boolean"
|
||||
},
|
||||
"experimental.autoMarkPrompts": {
|
||||
"deprecated": true,
|
||||
"description": "This has been replaced by autoMarkPrompts in 1.21",
|
||||
"type": "boolean"
|
||||
"type": "boolean",
|
||||
"description": "[Deprecated] Replaced with the \"autoMarkPrompts\" setting.",
|
||||
"deprecated": true
|
||||
},
|
||||
"experimental.retroTerminalEffect": {
|
||||
"description": "When set to true, enable retro terminal effects. This is an experimental feature, and its continued existence is not guaranteed.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"experimental.showMarksOnScrollbar": {
|
||||
"deprecated": true,
|
||||
"description": "This has been replaced by showMarksOnScrollbar in 1.21",
|
||||
"type": "boolean"
|
||||
"type": "boolean",
|
||||
"description": "[Deprecated] Replaced with the \"showMarksOnScrollbar\" setting.",
|
||||
"deprecated": true
|
||||
},
|
||||
"showMarksOnScrollbar": {
|
||||
"default": false,
|
||||
"description": "When set to true, marks added to the buffer via the addMark action will appear on the scrollbar.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"experimental.rainbowSuggestions": {
|
||||
"type": "boolean",
|
||||
"description": "Enables displaying command suggestions in the terminal in RGB (all the colors of the rainbow!).",
|
||||
"default": false
|
||||
},
|
||||
"experimental.rightClickContextMenu": {
|
||||
"default": false,
|
||||
"description": "When true, right-click shows a context menu; otherwise, it pastes from the clipboard or copies selection.",
|
||||
@@ -2943,23 +2965,29 @@
|
||||
"type": "string"
|
||||
},
|
||||
"fontFace": {
|
||||
"default": "Cascadia Mono",
|
||||
"description": "[deprecated] Define 'face' within the 'font' object instead.",
|
||||
"type": "string",
|
||||
"description": "[Deprecated] Replaced with the \"face\" setting within the \"font\" object.",
|
||||
"default": "Cascadia Mono",
|
||||
"deprecated": true
|
||||
},
|
||||
"fontSize": {
|
||||
"default": 12,
|
||||
"description": "[deprecated] Define 'size' within the 'font' object instead.",
|
||||
"minimum": 1,
|
||||
"type": "number",
|
||||
"description": "[Deprecated] Replaced with the \"size\" setting within the \"font\" object.",
|
||||
"default": 12,
|
||||
"minimum": 1,
|
||||
"deprecated": true
|
||||
},
|
||||
"fontWeight": {
|
||||
"description": "[Deprecated] Replaced with the \"weight\" setting within the \"font\" object.",
|
||||
"default": "normal",
|
||||
"description": "[deprecated] Define 'weight' within the 'font' object instead.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer",
|
||||
"minimum": 100,
|
||||
"maximum": 990
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"thin",
|
||||
"extra-light",
|
||||
@@ -2972,13 +3000,7 @@
|
||||
"extra-bold",
|
||||
"black",
|
||||
"extra-black"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"maximum": 990,
|
||||
"minimum": 100,
|
||||
"type": "integer"
|
||||
]
|
||||
}
|
||||
],
|
||||
"deprecated": true
|
||||
@@ -3089,7 +3111,10 @@
|
||||
},
|
||||
"answerbackMessage": {
|
||||
"description": "The response that is sent when an ENQ control character is received.",
|
||||
"type": "string"
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"source": {
|
||||
"description": "Stores the name of the profile generator that originated this profile.",
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
// - ulSize - The height of the cursor within this buffer
|
||||
Cursor::Cursor(const ULONG ulSize, TextBuffer& parentBuffer) noexcept :
|
||||
_parentBuffer{ parentBuffer },
|
||||
_fHasMoved(false),
|
||||
_fIsVisible(true),
|
||||
_fIsOn(true),
|
||||
_fIsDouble(false),
|
||||
@@ -35,11 +34,6 @@ til::point Cursor::GetPosition() const noexcept
|
||||
return _cPosition;
|
||||
}
|
||||
|
||||
bool Cursor::HasMoved() const noexcept
|
||||
{
|
||||
return _fHasMoved;
|
||||
}
|
||||
|
||||
bool Cursor::IsVisible() const noexcept
|
||||
{
|
||||
return _fIsVisible;
|
||||
@@ -75,11 +69,6 @@ ULONG Cursor::GetSize() const noexcept
|
||||
return _ulSize;
|
||||
}
|
||||
|
||||
void Cursor::SetHasMoved(const bool fHasMoved) noexcept
|
||||
{
|
||||
_fHasMoved = fHasMoved;
|
||||
}
|
||||
|
||||
void Cursor::SetIsVisible(const bool fIsVisible) noexcept
|
||||
{
|
||||
_fIsVisible = fIsVisible;
|
||||
@@ -249,7 +238,6 @@ void Cursor::CopyProperties(const Cursor& OtherCursor) noexcept
|
||||
// We shouldn't copy the position as it will be already rearranged by the resize operation.
|
||||
//_cPosition = pOtherCursor->_cPosition;
|
||||
|
||||
_fHasMoved = OtherCursor._fHasMoved;
|
||||
_fIsVisible = OtherCursor._fIsVisible;
|
||||
_fIsOn = OtherCursor._fIsOn;
|
||||
_fIsDouble = OtherCursor._fIsDouble;
|
||||
|
||||
@@ -38,7 +38,6 @@ public:
|
||||
Cursor(Cursor&&) = default;
|
||||
Cursor& operator=(Cursor&&) & = delete;
|
||||
|
||||
bool HasMoved() const noexcept;
|
||||
bool IsVisible() const noexcept;
|
||||
bool IsOn() const noexcept;
|
||||
bool IsBlinkingAllowed() const noexcept;
|
||||
@@ -54,7 +53,6 @@ public:
|
||||
bool IsDeferDrawing() noexcept;
|
||||
void EndDeferDrawing() noexcept;
|
||||
|
||||
void SetHasMoved(const bool fHasMoved) noexcept;
|
||||
void SetIsVisible(const bool fIsVisible) noexcept;
|
||||
void SetIsOn(const bool fIsOn) noexcept;
|
||||
void SetBlinkingAllowed(const bool fIsOn) noexcept;
|
||||
@@ -90,7 +88,6 @@ private:
|
||||
|
||||
til::point _cPosition; // current position on screen (in screen buffer coords).
|
||||
|
||||
bool _fHasMoved;
|
||||
bool _fIsVisible; // whether cursor is visible (set only through the API)
|
||||
bool _fIsOn; // whether blinking cursor is on or not
|
||||
bool _fIsDouble; // whether the cursor size should be doubled
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
|
||||
#include "../TerminalApp/TerminalPage.h"
|
||||
#include "../UnitTests_SettingsModel/TestUtils.h"
|
||||
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
|
||||
|
||||
using namespace Microsoft::Console;
|
||||
using namespace WEX::Logging;
|
||||
using namespace WEX::TestExecution;
|
||||
using namespace WEX::Common;
|
||||
using namespace winrt::TerminalApp;
|
||||
using namespace winrt::Microsoft::Terminal::Settings;
|
||||
using namespace winrt::Microsoft::Terminal::Settings::Model;
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
|
||||
@@ -1419,10 +1421,10 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(L"profile0", terminalArgs.Profile());
|
||||
VERIFY_IS_NULL(terminalArgs.Elevate());
|
||||
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
|
||||
const auto termSettings = termSettingsResult.DefaultSettings();
|
||||
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings.Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
|
||||
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings->Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
|
||||
}
|
||||
{
|
||||
Log::Comment(L"profile.elevate=true, action.elevate=nullopt: DO auto elevate");
|
||||
@@ -1442,10 +1444,10 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(L"profile1", terminalArgs.Profile());
|
||||
VERIFY_IS_NULL(terminalArgs.Elevate());
|
||||
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
|
||||
const auto termSettings = termSettingsResult.DefaultSettings();
|
||||
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings.Commandline());
|
||||
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
|
||||
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings->Commandline());
|
||||
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
|
||||
}
|
||||
{
|
||||
Log::Comment(L"profile.elevate=false, action.elevate=nullopt: don't auto elevate");
|
||||
@@ -1465,10 +1467,10 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_ARE_EQUAL(L"profile2", terminalArgs.Profile());
|
||||
VERIFY_IS_NULL(terminalArgs.Elevate());
|
||||
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
|
||||
const auto termSettings = termSettingsResult.DefaultSettings();
|
||||
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings.Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
|
||||
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings->Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1490,10 +1492,10 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
|
||||
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
|
||||
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
|
||||
const auto termSettings = termSettingsResult.DefaultSettings();
|
||||
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings.Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
|
||||
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings->Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
|
||||
}
|
||||
{
|
||||
Log::Comment(L"profile.elevate=true, action.elevate=false: don't auto elevate");
|
||||
@@ -1514,10 +1516,10 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
|
||||
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
|
||||
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
|
||||
const auto termSettings = termSettingsResult.DefaultSettings();
|
||||
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings.Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
|
||||
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings->Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
|
||||
}
|
||||
{
|
||||
Log::Comment(L"profile.elevate=false, action.elevate=false: don't auto elevate");
|
||||
@@ -1538,10 +1540,10 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
|
||||
VERIFY_IS_FALSE(terminalArgs.Elevate().Value());
|
||||
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
|
||||
const auto termSettings = termSettingsResult.DefaultSettings();
|
||||
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings.Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings.Elevate());
|
||||
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings->Commandline());
|
||||
VERIFY_ARE_EQUAL(false, termSettings->Elevate());
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1563,10 +1565,10 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
|
||||
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
|
||||
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
|
||||
const auto termSettings = termSettingsResult.DefaultSettings();
|
||||
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings.Commandline());
|
||||
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
|
||||
VERIFY_ARE_EQUAL(L"cmd.exe", termSettings->Commandline());
|
||||
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
|
||||
}
|
||||
{
|
||||
Log::Comment(L"profile.elevate=true, action.elevate=true: DO auto elevate");
|
||||
@@ -1586,10 +1588,10 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
|
||||
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
|
||||
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
|
||||
const auto termSettings = termSettingsResult.DefaultSettings();
|
||||
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings.Commandline());
|
||||
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
|
||||
VERIFY_ARE_EQUAL(L"pwsh.exe", termSettings->Commandline());
|
||||
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
|
||||
}
|
||||
{
|
||||
Log::Comment(L"profile.elevate=false, action.elevate=true: DO auto elevate");
|
||||
@@ -1610,10 +1612,10 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_IS_NOT_NULL(terminalArgs.Elevate());
|
||||
VERIFY_IS_TRUE(terminalArgs.Elevate().Value());
|
||||
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs, nullptr);
|
||||
const auto termSettingsResult = TerminalSettings::CreateWithNewTerminalArgs(settings, terminalArgs);
|
||||
const auto termSettings = termSettingsResult.DefaultSettings();
|
||||
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings.Commandline());
|
||||
VERIFY_ARE_EQUAL(true, termSettings.Elevate());
|
||||
VERIFY_ARE_EQUAL(L"wsl.exe", termSettings->Commandline());
|
||||
VERIFY_ARE_EQUAL(true, termSettings->Elevate());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ namespace TerminalAppLocalTests
|
||||
// can help you identify if something much lower in the stack has
|
||||
// failed.
|
||||
TEST_METHOD(EnsureTestsActivate);
|
||||
TEST_METHOD(TryCreateSettingsType);
|
||||
TEST_METHOD(TryCreateConnectionType);
|
||||
TEST_METHOD(TryCreateXamlObjects);
|
||||
|
||||
@@ -131,23 +130,12 @@ namespace TerminalAppLocalTests
|
||||
VERIFY_IS_TRUE(true);
|
||||
}
|
||||
|
||||
void TabTests::TryCreateSettingsType()
|
||||
{
|
||||
// Verify we can create a WinRT type we authored
|
||||
// Just creating it is enough to know that everything is working.
|
||||
TerminalSettings settings;
|
||||
VERIFY_IS_NOT_NULL(settings);
|
||||
}
|
||||
|
||||
void TabTests::TryCreateConnectionType()
|
||||
{
|
||||
// Verify we can create a WinRT type we authored
|
||||
// Just creating it is enough to know that everything is working.
|
||||
winrt::Microsoft::Terminal::TerminalConnection::EchoConnection conn{};
|
||||
VERIFY_IS_NOT_NULL(conn);
|
||||
// We're doing this test separately from the TryCreateSettingsType test,
|
||||
// to ensure both dependent binaries (TerminalSettings and
|
||||
// TerminalConnection) both work individually.
|
||||
}
|
||||
|
||||
void TabTests::TryCreateXamlObjects()
|
||||
@@ -1306,6 +1294,15 @@ namespace TerminalAppLocalTests
|
||||
});
|
||||
}
|
||||
|
||||
static til::color _getControlBackgroundColor(winrt::TerminalApp::implementation::ContentManager* contentManager,
|
||||
const winrt::Microsoft::Terminal::Control::TermControl& c)
|
||||
{
|
||||
auto interactivity{ contentManager->TryLookupCore(c.ContentId()) };
|
||||
VERIFY_IS_NOT_NULL(interactivity);
|
||||
const auto core{ interactivity.Core() };
|
||||
return til::color{ core.BackgroundColor() };
|
||||
}
|
||||
|
||||
void TabTests::TestPreviewCommitScheme()
|
||||
{
|
||||
Log::Comment(L"Preview a color scheme. Make sure it's applied, then committed accordingly");
|
||||
@@ -1313,14 +1310,12 @@ namespace TerminalAppLocalTests
|
||||
auto page = _commonSetup();
|
||||
VERIFY_IS_NOT_NULL(page);
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, backgroundColor);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
@@ -1330,15 +1325,13 @@ namespace TerminalAppLocalTests
|
||||
page->_PreviewAction(actionAndArgs);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
Log::Comment(L"Color should be changed to the preview");
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, backgroundColor);
|
||||
|
||||
// And we should have stored a function to revert the change.
|
||||
VERIFY_ARE_EQUAL(1u, page->_restorePreviewFuncs.size());
|
||||
@@ -1352,15 +1345,13 @@ namespace TerminalAppLocalTests
|
||||
page->_HandleSetColorScheme(nullptr, ActionEventArgs{ args });
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
Log::Comment(L"Color should be changed");
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, backgroundColor);
|
||||
|
||||
// After preview there should be no more restore functions to execute.
|
||||
VERIFY_ARE_EQUAL(0u, page->_restorePreviewFuncs.size());
|
||||
@@ -1381,14 +1372,12 @@ namespace TerminalAppLocalTests
|
||||
auto page = _commonSetup();
|
||||
VERIFY_IS_NOT_NULL(page);
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, backgroundColor);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
@@ -1398,15 +1387,13 @@ namespace TerminalAppLocalTests
|
||||
page->_PreviewAction(actionAndArgs);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
Log::Comment(L"Color should be changed to the preview");
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, backgroundColor);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
@@ -1414,15 +1401,13 @@ namespace TerminalAppLocalTests
|
||||
page->_EndPreview();
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
Log::Comment(L"Color should be the same as it originally was");
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, backgroundColor);
|
||||
});
|
||||
Log::Comment(L"Sleep to let events propagate");
|
||||
Sleep(250);
|
||||
@@ -1437,14 +1422,12 @@ namespace TerminalAppLocalTests
|
||||
auto page = _commonSetup();
|
||||
VERIFY_IS_NOT_NULL(page);
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff0c0c0c }, backgroundColor);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
@@ -1453,15 +1436,13 @@ namespace TerminalAppLocalTests
|
||||
page->_PreviewColorScheme(args);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
Log::Comment(L"Color should be changed to the preview");
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xff000000 }, backgroundColor);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
@@ -1470,15 +1451,13 @@ namespace TerminalAppLocalTests
|
||||
page->_PreviewColorScheme(args);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
Log::Comment(L"Color should be changed to the preview");
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, backgroundColor);
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
@@ -1489,15 +1468,13 @@ namespace TerminalAppLocalTests
|
||||
page->_HandleSetColorScheme(nullptr, ActionEventArgs{ args });
|
||||
});
|
||||
|
||||
TestOnUIThread([&page]() {
|
||||
TestOnUIThread([&page, this]() {
|
||||
const auto& activeControl{ page->_GetActiveControl() };
|
||||
VERIFY_IS_NOT_NULL(activeControl);
|
||||
|
||||
const auto& controlSettings = activeControl.Settings();
|
||||
VERIFY_IS_NOT_NULL(controlSettings);
|
||||
|
||||
Log::Comment(L"Color should be changed");
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, til::color{ controlSettings.DefaultBackground() });
|
||||
const auto backgroundColor{ _getControlBackgroundColor(_contentManager.get(), activeControl) };
|
||||
VERIFY_ARE_EQUAL(til::color{ 0xffFAFAFA }, backgroundColor);
|
||||
});
|
||||
Log::Comment(L"Sleep to let events propagate");
|
||||
Sleep(250);
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalApp\dll\TerminalApp.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsModel\dll\Microsoft.Terminal.Settings.Model.vcxproj" />
|
||||
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsAppAdapterLib\TerminalSettingsAppAdapterLib.vcxproj">
|
||||
<Project>{3c46e2b0-ae6c-4132-9122-6772fb411959}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- ========================= Globals ======================== -->
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<VcpkgAutoLink>false</VcpkgAutoLink>
|
||||
|
||||
<TerminalMUX>true</TerminalMUX>
|
||||
<TerminalThemeHelpers>true</TerminalThemeHelpers>
|
||||
|
||||
<!--
|
||||
These two properties are very important!
|
||||
@@ -114,6 +115,9 @@
|
||||
<Project>{CA5CAD1A-082C-4476-9F33-94B339494076}</Project>
|
||||
</ProjectReference>
|
||||
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\UIHelpers\UIHelpers.vcxproj">
|
||||
<Project>{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "TerminalPage.h"
|
||||
#include "Utils.h"
|
||||
#include "../../types/inc/utils.hpp"
|
||||
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
|
||||
|
||||
#include <LibraryResources.h>
|
||||
|
||||
@@ -97,24 +98,19 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (const auto& scheme{ _settings.GlobalSettings().ColorSchemes().TryLookup(args.SchemeName()) })
|
||||
{
|
||||
const auto backup = _restorePreviewFuncs.empty();
|
||||
// Clear the saved preview funcs because we don't need to add a restore each time
|
||||
// the preview color changes, we only need to be able to restore the last one.
|
||||
_restorePreviewFuncs.clear();
|
||||
|
||||
_ApplyToActiveControls([&](const auto& control) {
|
||||
// Stash a copy of the current scheme.
|
||||
auto originalScheme{ control.ColorScheme() };
|
||||
auto temporarySettings{ winrt::make_self<Settings::TerminalSettings>() };
|
||||
temporarySettings->ApplyColorScheme(scheme);
|
||||
control.ApplyPreviewColorScheme(temporarySettings.try_as<winrt::Microsoft::Terminal::Core::ICoreScheme>());
|
||||
|
||||
// Apply the new scheme.
|
||||
control.ColorScheme(scheme.ToCoreScheme());
|
||||
|
||||
if (backup)
|
||||
{
|
||||
// Each control will emplace a revert into the
|
||||
// _restorePreviewFuncs for itself.
|
||||
_restorePreviewFuncs.emplace_back([=]() {
|
||||
// On dismiss, restore the original scheme.
|
||||
control.ColorScheme(originalScheme);
|
||||
});
|
||||
}
|
||||
// Take a copy of the inputs, since they are pointers anyways.
|
||||
_restorePreviewFuncs.emplace_back([=]() {
|
||||
control.ResetPreviewColorScheme();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "ScratchpadContent.h"
|
||||
#include "../WinRTUtils/inc/WtExeUtils.h"
|
||||
#include "../../types/inc/utils.hpp"
|
||||
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace winrt::Windows::ApplicationModel::DataTransfer;
|
||||
@@ -668,8 +669,10 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (const auto scheme = _settings.GlobalSettings().ColorSchemes().TryLookup(realArgs.SchemeName()))
|
||||
{
|
||||
auto temporarySettings{ winrt::make_self<Settings::TerminalSettings>() };
|
||||
temporarySettings->ApplyColorScheme(scheme);
|
||||
const auto res = _ApplyToActiveControls([&](auto& control) {
|
||||
control.ColorScheme(scheme.ToCoreScheme());
|
||||
control.SetOverrideColorScheme(temporarySettings.try_as<winrt::Microsoft::Terminal::Core::ICoreScheme>());
|
||||
});
|
||||
args.Handled(res);
|
||||
}
|
||||
|
||||
@@ -44,10 +44,6 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
_args = { value.begin(), value.end() };
|
||||
_parseResult = _parsed.ParseArgs(_args);
|
||||
if (_parseResult == 0)
|
||||
{
|
||||
_parsed.ValidateStartupCommands();
|
||||
}
|
||||
}
|
||||
|
||||
winrt::com_array<winrt::hstring> CommandlineArgs::Commandline()
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
<value>終了</value>
|
||||
</data>
|
||||
<data name="MultiplePanes" xml:space="preserve">
|
||||
<value>複数ウィンドウ</value>
|
||||
<value>複数ペイン</value>
|
||||
</data>
|
||||
<data name="TabCloseSubMenu" xml:space="preserve">
|
||||
<value>閉じる</value>
|
||||
@@ -203,13 +203,13 @@
|
||||
<value>タブを閉じる</value>
|
||||
</data>
|
||||
<data name="PaneClose" xml:space="preserve">
|
||||
<value>ウィンドウを閉じる</value>
|
||||
<value>ペインを閉じる</value>
|
||||
</data>
|
||||
<data name="SplitTabText" xml:space="preserve">
|
||||
<value>タブを分割</value>
|
||||
</data>
|
||||
<data name="SplitPaneText" xml:space="preserve">
|
||||
<value>ウィンドウを分割する</value>
|
||||
<value>ペインを分割する</value>
|
||||
</data>
|
||||
<data name="SplitPaneToolTipText" xml:space="preserve">
|
||||
<value>分割する方向を右クリック - 右/下/上/左</value>
|
||||
@@ -230,7 +230,7 @@
|
||||
<value>複製</value>
|
||||
</data>
|
||||
<data name="SwapPaneText" xml:space="preserve">
|
||||
<value>ウィンドウを入れ替える</value>
|
||||
<value>ペインを入れ替える</value>
|
||||
</data>
|
||||
<data name="SwapPaneDownText" xml:space="preserve">
|
||||
<value>下とペインを入れ替え</value>
|
||||
@@ -245,10 +245,10 @@
|
||||
<value>左とペインを入れ替え</value>
|
||||
</data>
|
||||
<data name="TogglePaneZoomText" xml:space="preserve">
|
||||
<value>ウィンドウのズームの切り替え</value>
|
||||
<value>ペインのズームの切り替え</value>
|
||||
</data>
|
||||
<data name="CloseOtherPanesText" xml:space="preserve">
|
||||
<value>他のウィンドウを閉じる</value>
|
||||
<value>他のペインを閉じる</value>
|
||||
</data>
|
||||
<data name="SearchWebText" xml:space="preserve">
|
||||
<value>Web 検索</value>
|
||||
@@ -345,17 +345,17 @@
|
||||
<value>指定されたインデックスのタブにフォーカスを移動する</value>
|
||||
</data>
|
||||
<data name="CmdMovePaneTabArgDesc" xml:space="preserve">
|
||||
<value>フォーカスされたウィンドウを指定されたインデックスのタブに移動する</value>
|
||||
<value>フォーカスされたペインを指定されたインデックスのタブに移動する</value>
|
||||
</data>
|
||||
<data name="CmdMovePaneDesc" xml:space="preserve">
|
||||
<value>フォーカスされたウィンドウを別のタブに移動する</value>
|
||||
<value>フォーカスされたペインを別のタブに移動する</value>
|
||||
</data>
|
||||
<data name="CmdMPDesc" xml:space="preserve">
|
||||
<value>"move-pane" サブコマンドのエイリアス。</value>
|
||||
<comment>{Locked="\"move-pane\""}</comment>
|
||||
</data>
|
||||
<data name="CmdSplitPaneSizeArgDesc" xml:space="preserve">
|
||||
<value>サイズを親ウィンドウに対する割合として指定します。有効な値は (0,1) の間で、排他的です。</value>
|
||||
<value>サイズを親ペインに対する割合として指定します。有効な値は (0,1) の間で、排他的です。</value>
|
||||
</data>
|
||||
<data name="CmdNewTabDesc" xml:space="preserve">
|
||||
<value>新しいタブの作成</value>
|
||||
@@ -365,14 +365,14 @@
|
||||
<comment>{Locked="\"new-tab\""}</comment>
|
||||
</data>
|
||||
<data name="CmdFocusPaneDesc" xml:space="preserve">
|
||||
<value>別のウィンドウにフォーカスを移動する</value>
|
||||
<value>別のペインにフォーカスを移動する</value>
|
||||
</data>
|
||||
<data name="CmdFPDesc" xml:space="preserve">
|
||||
<value>"focus-pane" サブコマンドのエイリアス。</value>
|
||||
<comment>{Locked="\"focus-pane\""}</comment>
|
||||
</data>
|
||||
<data name="CmdFocusPaneTargetArgDesc" xml:space="preserve">
|
||||
<value>指定されたインデックスのウィンドウをフォーカスする</value>
|
||||
<value>指定されたインデックスのペインをフォーカスする</value>
|
||||
</data>
|
||||
<data name="CmdProfileArgDesc" xml:space="preserve">
|
||||
<value>指定されたプロファイルで開きます。プロファイルの名前または GUID を指定できます</value>
|
||||
@@ -381,20 +381,20 @@
|
||||
<value>WT_SESSION 変数を設定します; GUID である必要があります</value>
|
||||
</data>
|
||||
<data name="CmdSplitPaneDesc" xml:space="preserve">
|
||||
<value>新しい分割ウィンドウの作成</value>
|
||||
<value>新しい分割ペインの作成</value>
|
||||
</data>
|
||||
<data name="CmdSPDesc" xml:space="preserve">
|
||||
<value>"split-pane" サブコマンドのエイリアス。</value>
|
||||
<comment>{Locked="\"split-pane\""}</comment>
|
||||
</data>
|
||||
<data name="CmdSplitPaneHorizontalArgDesc" xml:space="preserve">
|
||||
<value>新しいウィンドウを水平方向に分割して作成します ([-]と考えてください)</value>
|
||||
<value>新しいペインを水平方向に分割して作成します ([-]と考えてください)</value>
|
||||
</data>
|
||||
<data name="CmdSplitPaneVerticalArgDesc" xml:space="preserve">
|
||||
<value>新しいウィンドウを垂直方向に分割して作成します ([|]と考えてください)</value>
|
||||
<value>新しいペインを垂直方向に分割して作成します ([|]と考えてください)</value>
|
||||
</data>
|
||||
<data name="CmdSplitPaneDuplicateArgDesc" xml:space="preserve">
|
||||
<value>フォーカスされたウィンドウのプロファイルを複製して、新しいウィンドウを作成します</value>
|
||||
<value>フォーカスされたペインのプロファイルを複製して、新しいペインを作成します</value>
|
||||
</data>
|
||||
<data name="CmdStartingDirArgDesc" xml:space="preserve">
|
||||
<value>プロファイルの "startingDirectory" の設定ではなく、指定されたディレクトリで開きます</value>
|
||||
@@ -439,10 +439,10 @@
|
||||
<value>フォーカスを移動する方向</value>
|
||||
</data>
|
||||
<data name="CmdSwapPaneDesc" xml:space="preserve">
|
||||
<value>フォーカスされたウィンドウを、指定された方向の隣接するウィンドウと入れ替える</value>
|
||||
<value>フォーカスされたペインを、指定された方向の隣接するペインと入れ替える</value>
|
||||
</data>
|
||||
<data name="CmdSwapPaneDirectionArgDesc" xml:space="preserve">
|
||||
<value>フォーカスされたウィンドウを移動する方向</value>
|
||||
<value>フォーカスされたペインを移動する方向</value>
|
||||
</data>
|
||||
<data name="CmdFocusDesc" xml:space="preserve">
|
||||
<value>ウィンドウをフォーカス モードで起動</value>
|
||||
@@ -872,10 +872,10 @@
|
||||
<value>なし</value>
|
||||
</data>
|
||||
<data name="ClosePaneText" xml:space="preserve">
|
||||
<value>ウィンドウを閉じる</value>
|
||||
<value>ペインを閉じる</value>
|
||||
</data>
|
||||
<data name="ClosePaneToolTip" xml:space="preserve">
|
||||
<value>複数のウィンドウが存在する場合は、アクティブなウィンドウを閉じます</value>
|
||||
<value>複数のペインが存在する場合は、アクティブなペインを閉じます</value>
|
||||
</data>
|
||||
<data name="TabColorClearButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.FullDescription" xml:space="preserve">
|
||||
<value>タブの色をリセット</value>
|
||||
@@ -892,7 +892,7 @@
|
||||
<comment>This text is displayed on context menu for profile entries in add new tab button.</comment>
|
||||
</data>
|
||||
<data name="TerminalPage_PaneMovedAnnouncement_ExistingTab" xml:space="preserve">
|
||||
<value>アクティブなウィンドウを [{0}] タブに移動しました</value>
|
||||
<value>アクティブなペインを [{0}] タブに移動しました</value>
|
||||
<comment>{Locked="{0}"}This text is read out by screen readers upon a successful pane movement. {0} is the name of the tab the pane was moved to.</comment>
|
||||
</data>
|
||||
<data name="TerminalPage_TabMovedAnnouncement_Default" xml:space="preserve">
|
||||
@@ -908,19 +908,19 @@
|
||||
<comment>{Locked="{0}"}{Locked="{1}"}This text is read out by screen readers upon a successful tab movement. {0} is the name of the tab. {1} is the new tab index in the tab row.</comment>
|
||||
</data>
|
||||
<data name="TerminalPage_PaneMovedAnnouncement_ExistingWindow" xml:space="preserve">
|
||||
<value>アクティブなウィンドウを "{1}" ウィンドウの [{0}] タブに移動しました</value>
|
||||
<value>アクティブなペインを "{1}" ウィンドウの [{0}] タブに移動しました</value>
|
||||
<comment>{Locked="{0}"}{Locked="{1}"}This text is read out by screen readers upon a successful pane movement. {0} is the name of the tab the pane was moved to. {1} is the name of the window the pane was moved to. Replaced in 1.19 by TerminalPage_PaneMovedAnnouncement_ExistingWindow2</comment>
|
||||
</data>
|
||||
<data name="TerminalPage_PaneMovedAnnouncement_ExistingWindow2" xml:space="preserve">
|
||||
<value>アクティブなウィンドウを "{0}" ウィンドウに移動しました</value>
|
||||
<value>アクティブなペインを "{0}" ウィンドウに移動しました</value>
|
||||
<comment>{Locked="{0}"}This text is read out by screen readers upon a successful pane movement. {0} is the name of the window the pane was moved to.</comment>
|
||||
</data>
|
||||
<data name="TerminalPage_PaneMovedAnnouncement_NewWindow" xml:space="preserve">
|
||||
<value>アクティブなウィンドウを新しいウィンドウに移動しました</value>
|
||||
<value>アクティブなペインを新しいウィンドウに移動しました</value>
|
||||
<comment>This text is read out by screen readers upon a successful pane movement to a new window.</comment>
|
||||
</data>
|
||||
<data name="TerminalPage_PaneMovedAnnouncement_NewTab" xml:space="preserve">
|
||||
<value>アクティブなウィンドウを新しいタブに移動しました</value>
|
||||
<value>アクティブなペインを新しいタブに移動しました</value>
|
||||
<comment>This text is read out by screen readers upon a successful pane movement to a new tab within the existing window.</comment>
|
||||
</data>
|
||||
<data name="CmdAppendCommandLineDesc" xml:space="preserve">
|
||||
@@ -961,10 +961,10 @@
|
||||
<value>操作の保存に失敗しました</value>
|
||||
</data>
|
||||
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||
<value>ウィンドウを閉じる</value>
|
||||
<value>ペインを閉じる</value>
|
||||
</data>
|
||||
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>ウィンドウを閉じる</value>
|
||||
<value>ペインを閉じる</value>
|
||||
</data>
|
||||
<data name="TabMoveLeft" xml:space="preserve">
|
||||
<value>左へ移動</value>
|
||||
|
||||
@@ -1062,7 +1062,6 @@ namespace winrt::TerminalApp::implementation
|
||||
dispatcher,
|
||||
til::throttled_func_options{
|
||||
.delay = std::chrono::milliseconds{ 200 },
|
||||
.leading = true,
|
||||
.trailing = true,
|
||||
},
|
||||
[weakThis]() {
|
||||
@@ -2418,7 +2417,7 @@ namespace winrt::TerminalApp::implementation
|
||||
const auto& currentDictionary = v.as<ResourceDictionary>();
|
||||
|
||||
// TabViewItem.Background
|
||||
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderBackground"), deselectedTabBrush);
|
||||
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderBackground"), selectedTabBrush);
|
||||
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
|
||||
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), isHighContrast ? fontBrush : hoverTabBrush);
|
||||
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "TabRowControl.h"
|
||||
#include "DebugTapConnection.h"
|
||||
#include "..\TerminalSettingsModel\FileUtils.h"
|
||||
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
|
||||
|
||||
#include <shlobj.h>
|
||||
|
||||
@@ -74,7 +75,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
return S_FALSE;
|
||||
}
|
||||
const auto settings{ TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs, *_bindings) };
|
||||
const auto settings{ Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs) };
|
||||
|
||||
// Try to handle auto-elevation
|
||||
if (_maybeElevate(newTerminalArgs, settings, profile))
|
||||
@@ -157,12 +158,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Set this tab's icon to the icon from the content
|
||||
_UpdateTabIcon(*newTabImpl);
|
||||
|
||||
// This is necessary, because WinUI does not have support for middle clicks.
|
||||
// Its Tapped event doesn't provide the information what button was used either.
|
||||
tabViewItem.PointerPressed({ this, &TerminalPage::_OnTabPointerPressed });
|
||||
tabViewItem.PointerReleased({ this, &TerminalPage::_OnTabPointerReleased });
|
||||
tabViewItem.PointerExited({ this, &TerminalPage::_OnTabPointerExited });
|
||||
tabViewItem.PointerEntered({ this, &TerminalPage::_OnTabPointerEntered });
|
||||
|
||||
// When the tab requests close, try to close it (prompt for approval, if required)
|
||||
newTabImpl->CloseRequested([weakTab, weakThis{ get_weak() }](auto&& /*s*/, auto&& /*e*/) {
|
||||
@@ -664,7 +660,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Method Description:
|
||||
// - returns a tab corresponding to a view item. This might return null,
|
||||
// so make sure to check the result!
|
||||
winrt::TerminalApp::Tab TerminalPage::_GetTabByTabViewItem(const Microsoft::UI::Xaml::Controls::TabViewItem& tabViewItem) const noexcept
|
||||
winrt::TerminalApp::Tab TerminalPage::_GetTabByTabViewItem(const IInspectable& tabViewItem) const noexcept
|
||||
{
|
||||
uint32_t tabIndexFromControl{};
|
||||
const auto items{ _tabView.TabItems() };
|
||||
@@ -876,60 +872,64 @@ namespace winrt::TerminalApp::implementation
|
||||
_UpdateTabView();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Additional responses to clicking on a TabView's item. Currently, just remove tab with middle click
|
||||
// Arguments:
|
||||
// - sender: the control that originated this event (TabViewItem)
|
||||
// - eventArgs: the event's constituent arguments
|
||||
void TerminalPage::_OnTabPointerPressed(const IInspectable& sender, const Windows::UI::Xaml::Input::PointerRoutedEventArgs& eventArgs)
|
||||
void TerminalPage::_OnTabPointerPressed(const IInspectable& sender, const Windows::UI::Xaml::Input::PointerRoutedEventArgs& e)
|
||||
{
|
||||
if (eventArgs.GetCurrentPoint(nullptr).Properties().IsMiddleButtonPressed())
|
||||
if (!_tabItemMiddleClickHookEnabled || !e.GetCurrentPoint(nullptr).Properties().IsMiddleButtonPressed())
|
||||
{
|
||||
if (const auto tabViewItem{ sender.try_as<MUX::Controls::TabViewItem>() })
|
||||
{
|
||||
_tabPointerMiddleButtonPressed = tabViewItem.CapturePointer(eventArgs.Pointer());
|
||||
_tabPointerMiddleButtonExited = false;
|
||||
}
|
||||
eventArgs.Handled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto tabViewItem = sender.try_as<MUX::Controls::TabViewItem>();
|
||||
if (!tabViewItem || !tabViewItem.CapturePointer(e.Pointer()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_tabItemMiddleClickExited = false;
|
||||
|
||||
_tabItemMiddleClickPointerEntered = tabViewItem.PointerEntered(winrt::auto_revoke, [this](auto&&, auto&& e) {
|
||||
_tabItemMiddleClickExited = false;
|
||||
e.Handled(true);
|
||||
});
|
||||
_tabItemMiddleClickPointerExited = tabViewItem.PointerExited(winrt::auto_revoke, [this](auto&&, auto&& e) {
|
||||
_tabItemMiddleClickExited = true;
|
||||
e.Handled(true);
|
||||
});
|
||||
_tabItemMiddleClickPointerCaptureLost = tabViewItem.PointerCaptureLost(winrt::auto_revoke, [this](auto&& sender, auto&& e) {
|
||||
// The WinUI TabView calls CapturePointer() internally and it's not reference counted,
|
||||
// so when it calls ReleasePointerCapture() in its PointerReleased handler,
|
||||
// we get a PointerCaptureLost before we receive the PointerReleased event.
|
||||
// This makes typical handling of PointerReleased events on our side difficult.
|
||||
// Well, whatever, now we just hook PointerCaptureLost because we know WinUI will trigger it.
|
||||
|
||||
_tabItemMiddleClickPointerEntered.revoke();
|
||||
_tabItemMiddleClickPointerExited.revoke();
|
||||
_tabItemMiddleClickPointerCaptureLost.revoke();
|
||||
|
||||
if (!_tabItemMiddleClickExited && !e.GetCurrentPoint(nullptr).Properties().IsMiddleButtonPressed())
|
||||
{
|
||||
_OnTabPointerReleasedCloseTab(std::move(sender));
|
||||
}
|
||||
|
||||
e.Handled(true);
|
||||
});
|
||||
e.Handled(true);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Tracking pointer state for tab remove
|
||||
// Arguments:
|
||||
// - sender: the control that originated this event (TabViewItem)
|
||||
// - eventArgs: the event's constituent arguments
|
||||
void TerminalPage::_OnTabPointerReleased(const IInspectable& sender, const Windows::UI::Xaml::Input::PointerRoutedEventArgs& eventArgs)
|
||||
safe_void_coroutine TerminalPage::_OnTabPointerReleasedCloseTab(IInspectable sender)
|
||||
{
|
||||
if (_tabPointerMiddleButtonPressed && !eventArgs.GetCurrentPoint(nullptr).Properties().IsMiddleButtonPressed())
|
||||
{
|
||||
_tabPointerMiddleButtonPressed = false;
|
||||
if (auto tabViewItem{ sender.try_as<MUX::Controls::TabViewItem>() })
|
||||
{
|
||||
tabViewItem.ReleasePointerCapture(eventArgs.Pointer());
|
||||
if (!_tabPointerMiddleButtonExited)
|
||||
{
|
||||
_OnTabPointerReleasedCloseTab(std::move(tabViewItem));
|
||||
}
|
||||
}
|
||||
eventArgs.Handled(true);
|
||||
}
|
||||
}
|
||||
|
||||
safe_void_coroutine TerminalPage::_OnTabPointerReleasedCloseTab(winrt::Microsoft::UI::Xaml::Controls::TabViewItem sender)
|
||||
{
|
||||
const auto tab = _GetTabByTabViewItem(sender);
|
||||
if (!tab)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
// WinUI asynchronously updates its tab view items, so it may happen that we're given a
|
||||
// `TabViewItem` that still contains a `Tab` which has actually already been removed.
|
||||
// First we must yield once, to flush out whatever TabView is currently doing.
|
||||
const auto strong = get_strong();
|
||||
co_await wil::resume_foreground(Dispatcher());
|
||||
|
||||
const auto tab = _GetTabByTabViewItem(sender);
|
||||
if (!tab)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
// `tab.Shutdown()` in `_RemoveTab()` sets the content to null = This checks if the tab is closed.
|
||||
if (tab.Content())
|
||||
{
|
||||
@@ -937,34 +937,6 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Tracking pointer state for tab remove
|
||||
// Arguments:
|
||||
// - sender: the control that originated this event (TabViewItem)
|
||||
// - eventArgs: the event's constituent arguments
|
||||
void TerminalPage::_OnTabPointerEntered(const IInspectable& /*sender*/, const Windows::UI::Xaml::Input::PointerRoutedEventArgs& eventArgs)
|
||||
{
|
||||
if (eventArgs.GetCurrentPoint(nullptr).Properties().IsMiddleButtonPressed())
|
||||
{
|
||||
_tabPointerMiddleButtonExited = false;
|
||||
eventArgs.Handled(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Tracking pointer state for tab remove
|
||||
// Arguments:
|
||||
// - sender: the control that originated this event (TabViewItem)
|
||||
// - eventArgs: the event's constituent arguments
|
||||
void TerminalPage::_OnTabPointerExited(const IInspectable& /*sender*/, const Windows::UI::Xaml::Input::PointerRoutedEventArgs& eventArgs)
|
||||
{
|
||||
if (eventArgs.GetCurrentPoint(nullptr).Properties().IsMiddleButtonPressed())
|
||||
{
|
||||
_tabPointerMiddleButtonExited = true;
|
||||
eventArgs.Handled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void TerminalPage::_UpdatedSelectedTab(const winrt::TerminalApp::Tab& tab)
|
||||
{
|
||||
// Unfocus all the tabs.
|
||||
|
||||
@@ -414,6 +414,9 @@
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\UIHelpers\UIHelpers.vcxproj">
|
||||
<Project>{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsAppAdapterLib\TerminalSettingsAppAdapterLib.vcxproj">
|
||||
<Project>{3c46e2b0-ae6c-4132-9122-6772fb411959}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\UIMarkdown\UIMarkdown.vcxproj">
|
||||
<Project>{7615F03F-E56D-4DB4-B23D-BD4FB80DB36F}</Project>
|
||||
<Private>true</Private>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "TerminalSettingsCache.h"
|
||||
#include "../../types/inc/ColorFix.hpp"
|
||||
#include "../../types/inc/utils.hpp"
|
||||
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
|
||||
|
||||
#include "LaunchPositionRequest.g.cpp"
|
||||
#include "RenameWindowRequestedArgs.g.cpp"
|
||||
@@ -60,8 +61,42 @@ namespace winrt
|
||||
|
||||
namespace clipboard
|
||||
{
|
||||
wil::unique_close_clipboard_call open(HWND hwnd)
|
||||
static SRWLOCK lock = SRWLOCK_INIT;
|
||||
|
||||
struct ClipboardHandle
|
||||
{
|
||||
explicit ClipboardHandle(bool open) :
|
||||
_open{ open }
|
||||
{
|
||||
}
|
||||
|
||||
~ClipboardHandle()
|
||||
{
|
||||
if (_open)
|
||||
{
|
||||
ReleaseSRWLockExclusive(&lock);
|
||||
CloseClipboard();
|
||||
}
|
||||
}
|
||||
|
||||
explicit operator bool() const noexcept
|
||||
{
|
||||
return _open;
|
||||
}
|
||||
|
||||
private:
|
||||
bool _open = false;
|
||||
};
|
||||
|
||||
ClipboardHandle open(HWND hwnd)
|
||||
{
|
||||
// Turns out, OpenClipboard/CloseClipboard are not thread-safe whatsoever,
|
||||
// and on CloseClipboard, the GetClipboardData handle may get freed.
|
||||
// The problem is that WinUI also uses OpenClipboard (through WinRT which uses OLE),
|
||||
// and so even with this mutex we can still crash randomly if you copy something via WinUI.
|
||||
// Makes you wonder how many Windows apps are subtly broken, huh.
|
||||
AcquireSRWLockExclusive(&lock);
|
||||
|
||||
bool success = false;
|
||||
|
||||
// OpenClipboard may fail to acquire the internal lock --> retry.
|
||||
@@ -80,7 +115,12 @@ namespace clipboard
|
||||
Sleep(sleep);
|
||||
}
|
||||
|
||||
return wil::unique_close_clipboard_call{ success };
|
||||
if (!success)
|
||||
{
|
||||
ReleaseSRWLockExclusive(&lock);
|
||||
}
|
||||
|
||||
return ClipboardHandle{ success };
|
||||
}
|
||||
|
||||
void write(wil::zwstring_view text, std::string_view html, std::string_view rtf)
|
||||
@@ -220,16 +260,6 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
_adjustProcessPriorityThrottled = std::make_shared<ThrottledFunc<>>(
|
||||
DispatcherQueue::GetForCurrentThread(),
|
||||
til::throttled_func_options{
|
||||
.delay = std::chrono::milliseconds{ 100 },
|
||||
.debounce = true,
|
||||
.trailing = true,
|
||||
},
|
||||
[=]() {
|
||||
_adjustProcessPriority();
|
||||
});
|
||||
_hostingHwnd = hwnd;
|
||||
return S_OK;
|
||||
}
|
||||
@@ -241,7 +271,7 @@ namespace winrt::TerminalApp::implementation
|
||||
if (_settings == nullptr)
|
||||
{
|
||||
// Create this only on the first time we load the settings.
|
||||
_terminalSettingsCache = std::make_shared<TerminalSettingsCache>(settings, *_bindings);
|
||||
_terminalSettingsCache = std::make_shared<TerminalSettingsCache>(settings);
|
||||
}
|
||||
_settings = settings;
|
||||
|
||||
@@ -344,6 +374,8 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
const auto visibility = theme.Tab() ? theme.Tab().ShowCloseButton() : Settings::Model::TabCloseButtonVisibility::Always;
|
||||
|
||||
_tabItemMiddleClickHookEnabled = visibility == Settings::Model::TabCloseButtonVisibility::Never;
|
||||
|
||||
switch (visibility)
|
||||
{
|
||||
case Settings::Model::TabCloseButtonVisibility::Never:
|
||||
@@ -410,6 +442,17 @@ namespace winrt::TerminalApp::implementation
|
||||
// them.
|
||||
|
||||
_tabRow.ShowElevationShield(IsRunningElevated() && _settings.GlobalSettings().ShowAdminShield());
|
||||
|
||||
_adjustProcessPriorityThrottled = std::make_shared<ThrottledFunc<>>(
|
||||
DispatcherQueue::GetForCurrentThread(),
|
||||
til::throttled_func_options{
|
||||
.delay = std::chrono::milliseconds{ 100 },
|
||||
.debounce = true,
|
||||
.trailing = true,
|
||||
},
|
||||
[=]() {
|
||||
_adjustProcessPriority();
|
||||
});
|
||||
}
|
||||
|
||||
Windows::UI::Xaml::Automation::Peers::AutomationPeer TerminalPage::OnCreateAutomationPeer()
|
||||
@@ -1423,7 +1466,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// Return value:
|
||||
// - the desired connection
|
||||
TerminalConnection::ITerminalConnection TerminalPage::_CreateConnectionFromSettings(Profile profile,
|
||||
TerminalSettings settings,
|
||||
IControlSettings settings,
|
||||
const bool inheritCursor)
|
||||
{
|
||||
static const auto textMeasurement = [&]() -> std::wstring_view {
|
||||
@@ -1473,9 +1516,8 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
else
|
||||
{
|
||||
const auto environment = settings.EnvironmentVariables() != nullptr ?
|
||||
settings.EnvironmentVariables().GetView() :
|
||||
nullptr;
|
||||
auto settingsInternal{ winrt::get_self<Settings::TerminalSettings>(settings) };
|
||||
const auto environment = settingsInternal->EnvironmentVariables();
|
||||
|
||||
// Update the path to be relative to whatever our CWD is.
|
||||
//
|
||||
@@ -1497,7 +1539,7 @@ namespace winrt::TerminalApp::implementation
|
||||
valueSet = TerminalConnection::ConptyConnection::CreateSettings(settings.Commandline(),
|
||||
newWorkingDirectory,
|
||||
settings.StartingTitle(),
|
||||
settings.ReloadEnvironmentVariables(),
|
||||
settingsInternal->ReloadEnvironmentVariables(),
|
||||
_WindowProperties.VirtualEnvVars(),
|
||||
environment,
|
||||
settings.InitialRows(),
|
||||
@@ -1551,20 +1593,20 @@ namespace winrt::TerminalApp::implementation
|
||||
const auto& connection = control.Connection();
|
||||
auto profile{ paneContent.GetProfile() };
|
||||
|
||||
TerminalSettingsCreateResult controlSettings{ nullptr };
|
||||
Settings::TerminalSettingsCreateResult controlSettings{ nullptr };
|
||||
|
||||
if (profile)
|
||||
{
|
||||
// TODO GH#5047 If we cache the NewTerminalArgs, we no longer need to do this.
|
||||
profile = GetClosestProfileForDuplicationOfProfile(profile);
|
||||
controlSettings = TerminalSettings::CreateWithProfile(_settings, profile, *_bindings);
|
||||
controlSettings = Settings::TerminalSettings::CreateWithProfile(_settings, profile);
|
||||
|
||||
// Replace the Starting directory with the CWD, if given
|
||||
const auto workingDirectory = control.WorkingDirectory();
|
||||
const auto validWorkingDirectory = !workingDirectory.empty();
|
||||
if (validWorkingDirectory)
|
||||
{
|
||||
controlSettings.DefaultSettings().StartingDirectory(workingDirectory);
|
||||
controlSettings.DefaultSettings()->StartingDirectory(workingDirectory);
|
||||
}
|
||||
|
||||
// To facilitate restarting defterm connections: grab the original
|
||||
@@ -1572,11 +1614,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// settings.
|
||||
if (const auto& conpty{ connection.try_as<TerminalConnection::ConptyConnection>() })
|
||||
{
|
||||
controlSettings.DefaultSettings().Commandline(conpty.Commandline());
|
||||
controlSettings.DefaultSettings()->Commandline(conpty.Commandline());
|
||||
}
|
||||
}
|
||||
|
||||
return _CreateConnectionFromSettings(profile, controlSettings.DefaultSettings(), true);
|
||||
return _CreateConnectionFromSettings(profile, *controlSettings.DefaultSettings(), true);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -3175,33 +3217,17 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
PackageCatalog catalog = connectResult.PackageCatalog();
|
||||
// clang-format off
|
||||
static constexpr std::array<WinGetSearchParams, 3> searches{ {
|
||||
{ .Field = PackageMatchField::Command, .MatchOption = PackageFieldMatchOption::StartsWithCaseInsensitive },
|
||||
{ .Field = PackageMatchField::Name, .MatchOption = PackageFieldMatchOption::ContainsCaseInsensitive },
|
||||
{ .Field = PackageMatchField::Moniker, .MatchOption = PackageFieldMatchOption::ContainsCaseInsensitive } } };
|
||||
// clang-format on
|
||||
|
||||
PackageMatchFilter filter = WindowsPackageManagerFactory::CreatePackageMatchFilter();
|
||||
filter.Value(query);
|
||||
filter.Field(PackageMatchField::Command);
|
||||
filter.Option(PackageFieldMatchOption::Equals);
|
||||
|
||||
FindPackagesOptions options = WindowsPackageManagerFactory::CreateFindPackagesOptions();
|
||||
options.Filters().Append(filter);
|
||||
options.ResultLimit(20);
|
||||
|
||||
IVectorView<MatchResult> pkgList;
|
||||
for (const auto& search : searches)
|
||||
{
|
||||
filter.Field(search.Field);
|
||||
filter.Option(search.MatchOption);
|
||||
|
||||
const auto result = co_await catalog.FindPackagesAsync(options);
|
||||
pkgList = result.Matches();
|
||||
if (pkgList.Size() > 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
const auto result = co_await catalog.FindPackagesAsync(options);
|
||||
const IVectorView<MatchResult> pkgList = result.Matches();
|
||||
co_return pkgList;
|
||||
}
|
||||
|
||||
@@ -3377,13 +3403,11 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
TermControl TerminalPage::_CreateNewControlAndContent(const TerminalSettingsCreateResult& settings, const ITerminalConnection& connection)
|
||||
TermControl TerminalPage::_CreateNewControlAndContent(const Settings::TerminalSettingsCreateResult& settings, const ITerminalConnection& connection)
|
||||
{
|
||||
// Do any initialization that needs to apply to _every_ TermControl we
|
||||
// create here.
|
||||
// TermControl will copy the settings out of the settings passed to it.
|
||||
|
||||
const auto content = _manager.CreateCore(settings.DefaultSettings(), settings.UnfocusedSettings(), connection);
|
||||
const auto content = _manager.CreateCore(*settings.DefaultSettings(), settings.UnfocusedSettings().try_as<IControlAppearance>(), connection);
|
||||
const TermControl control{ content };
|
||||
return _SetupControl(control);
|
||||
}
|
||||
@@ -3397,7 +3421,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// don't, then when we move the content to another thread, and it
|
||||
// tries to handle a key, it'll callback on the original page's
|
||||
// stack, inevitably resulting in a wrong_thread
|
||||
return _SetupControl(TermControl::NewControlByAttachingContent(content, *_bindings));
|
||||
return _SetupControl(TermControl::NewControlByAttachingContent(content));
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -3417,6 +3441,8 @@ namespace winrt::TerminalApp::implementation
|
||||
term.OwningHwnd(reinterpret_cast<uint64_t>(*_hostingHwnd));
|
||||
}
|
||||
|
||||
term.KeyBindings(*_bindings);
|
||||
|
||||
_RegisterTerminalEvents(term);
|
||||
return term;
|
||||
}
|
||||
@@ -3453,7 +3479,7 @@ namespace winrt::TerminalApp::implementation
|
||||
return std::make_shared<Pane>(paneContent);
|
||||
}
|
||||
|
||||
TerminalSettingsCreateResult controlSettings{ nullptr };
|
||||
Settings::TerminalSettingsCreateResult controlSettings{ nullptr };
|
||||
Profile profile{ nullptr };
|
||||
|
||||
if (const auto& tabImpl{ _GetTabImpl(sourceTab) })
|
||||
@@ -3463,19 +3489,19 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// TODO GH#5047 If we cache the NewTerminalArgs, we no longer need to do this.
|
||||
profile = GetClosestProfileForDuplicationOfProfile(profile);
|
||||
controlSettings = TerminalSettings::CreateWithProfile(_settings, profile, *_bindings);
|
||||
controlSettings = Settings::TerminalSettings::CreateWithProfile(_settings, profile);
|
||||
const auto workingDirectory = tabImpl->GetActiveTerminalControl().WorkingDirectory();
|
||||
const auto validWorkingDirectory = !workingDirectory.empty();
|
||||
if (validWorkingDirectory)
|
||||
{
|
||||
controlSettings.DefaultSettings().StartingDirectory(workingDirectory);
|
||||
controlSettings.DefaultSettings()->StartingDirectory(workingDirectory);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!profile)
|
||||
{
|
||||
profile = _settings.GetProfileForArgs(newTerminalArgs);
|
||||
controlSettings = TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs, *_bindings);
|
||||
controlSettings = Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, newTerminalArgs);
|
||||
}
|
||||
|
||||
// Try to handle auto-elevation
|
||||
@@ -3484,13 +3510,13 @@ namespace winrt::TerminalApp::implementation
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const auto sessionId = controlSettings.DefaultSettings().SessionId();
|
||||
const auto sessionId = controlSettings.DefaultSettings()->SessionId();
|
||||
const auto hasSessionId = sessionId != winrt::guid{};
|
||||
|
||||
auto connection = existingConnection ? existingConnection : _CreateConnectionFromSettings(profile, controlSettings.DefaultSettings(), hasSessionId);
|
||||
auto connection = existingConnection ? existingConnection : _CreateConnectionFromSettings(profile, *controlSettings.DefaultSettings(), hasSessionId);
|
||||
if (existingConnection)
|
||||
{
|
||||
connection.Resize(controlSettings.DefaultSettings().InitialRows(), controlSettings.DefaultSettings().InitialCols());
|
||||
connection.Resize(controlSettings.DefaultSettings()->InitialRows(), controlSettings.DefaultSettings()->InitialCols());
|
||||
}
|
||||
|
||||
TerminalConnection::ITerminalConnection debugConnection{ nullptr };
|
||||
@@ -3734,7 +3760,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, *_bindings);
|
||||
_terminalSettingsCache->Reset(_settings);
|
||||
|
||||
for (const auto& tab : _tabs)
|
||||
{
|
||||
@@ -3808,6 +3834,8 @@ namespace winrt::TerminalApp::implementation
|
||||
theme.Tab().ShowCloseButton() :
|
||||
Settings::Model::TabCloseButtonVisibility::Always;
|
||||
|
||||
_tabItemMiddleClickHookEnabled = visibility == Settings::Model::TabCloseButtonVisibility::Never;
|
||||
|
||||
for (const auto& tab : _tabs)
|
||||
{
|
||||
tab.CloseButtonVisibility(visibility);
|
||||
@@ -4643,7 +4671,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// - true iff we tossed this request to an elevated window. Callers can use
|
||||
// this result to early-return if needed.
|
||||
bool TerminalPage::_maybeElevate(const NewTerminalArgs& newTerminalArgs,
|
||||
const TerminalSettingsCreateResult& controlSettings,
|
||||
const Settings::TerminalSettingsCreateResult& controlSettings,
|
||||
const Profile& profile)
|
||||
{
|
||||
// When duplicating a tab there aren't any newTerminalArgs.
|
||||
@@ -4656,7 +4684,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// If we don't even want to elevate we can return early.
|
||||
// If we're already elevated we can also return, because it doesn't get any more elevated than that.
|
||||
if (!defaultSettings.Elevate() || IsRunningElevated())
|
||||
if (!defaultSettings->Elevate() || IsRunningElevated())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -4666,7 +4694,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// will be that profile's GUID. If there wasn't, then we'll use
|
||||
// whatever the default profile's GUID is.
|
||||
newTerminalArgs.Profile(::Microsoft::Console::Utils::GuidToString(profile.Guid()));
|
||||
newTerminalArgs.StartingDirectory(_evaluatePathForCwd(defaultSettings.StartingDirectory()));
|
||||
newTerminalArgs.StartingDirectory(_evaluatePathForCwd(defaultSettings->StartingDirectory()));
|
||||
_OpenElevatedWT(newTerminalArgs);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ namespace Microsoft::Terminal::Core
|
||||
class ControlKeyStates;
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings
|
||||
{
|
||||
struct TerminalSettingsCreateResult;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
struct TerminalSettingsCache;
|
||||
@@ -313,7 +318,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
std::wstring _evaluatePathForCwd(std::wstring_view path);
|
||||
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection _CreateConnectionFromSettings(Microsoft::Terminal::Settings::Model::Profile profile, Microsoft::Terminal::Settings::Model::TerminalSettings settings, const bool inheritCursor);
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection _CreateConnectionFromSettings(Microsoft::Terminal::Settings::Model::Profile profile, Microsoft::Terminal::Control::IControlSettings settings, const bool inheritCursor);
|
||||
winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection _duplicateConnectionForRestart(const TerminalApp::TerminalPaneContent& paneContent);
|
||||
void _restartPaneConnection(const TerminalApp::TerminalPaneContent&, const winrt::Windows::Foundation::IInspectable&);
|
||||
|
||||
@@ -391,7 +396,7 @@ namespace winrt::TerminalApp::implementation
|
||||
std::optional<uint32_t> _GetTabIndex(const TerminalApp::Tab& tab) const noexcept;
|
||||
TerminalApp::Tab _GetFocusedTab() const noexcept;
|
||||
winrt::com_ptr<Tab> _GetFocusedTabImpl() const noexcept;
|
||||
TerminalApp::Tab _GetTabByTabViewItem(const Microsoft::UI::Xaml::Controls::TabViewItem& tabViewItem) const noexcept;
|
||||
TerminalApp::Tab _GetTabByTabViewItem(const IInspectable& tabViewItem) const noexcept;
|
||||
|
||||
void _HandleClosePaneRequested(std::shared_ptr<Pane> pane);
|
||||
safe_void_coroutine _SetFocusedTab(const winrt::TerminalApp::Tab tab);
|
||||
@@ -435,13 +440,18 @@ namespace winrt::TerminalApp::implementation
|
||||
void _TabDragStarted(const IInspectable& sender, const IInspectable& eventArgs);
|
||||
void _TabDragCompleted(const IInspectable& sender, const IInspectable& eventArgs);
|
||||
|
||||
bool _tabPointerMiddleButtonPressed{ false };
|
||||
bool _tabPointerMiddleButtonExited{ false };
|
||||
// BODGY: WinUI's TabView has a broken close event handler:
|
||||
// If the close button is disabled, middle-clicking the tab raises no close
|
||||
// event. Because that's dumb, we implement our own middle-click handling.
|
||||
// `_tabItemMiddleClickHookEnabled` is true whenever the close button is hidden,
|
||||
// and that enables all of the rest of this machinery (and this workaround).
|
||||
bool _tabItemMiddleClickHookEnabled = false;
|
||||
bool _tabItemMiddleClickExited = false;
|
||||
PointerEntered_revoker _tabItemMiddleClickPointerEntered;
|
||||
PointerExited_revoker _tabItemMiddleClickPointerExited;
|
||||
PointerCaptureLost_revoker _tabItemMiddleClickPointerCaptureLost;
|
||||
void _OnTabPointerPressed(const IInspectable& sender, const Windows::UI::Xaml::Input::PointerRoutedEventArgs& eventArgs);
|
||||
void _OnTabPointerReleased(const IInspectable& sender, const Windows::UI::Xaml::Input::PointerRoutedEventArgs& eventArgs);
|
||||
safe_void_coroutine _OnTabPointerReleasedCloseTab(winrt::Microsoft::UI::Xaml::Controls::TabViewItem sender);
|
||||
void _OnTabPointerEntered(const IInspectable& sender, const Windows::UI::Xaml::Input::PointerRoutedEventArgs& eventArgs);
|
||||
void _OnTabPointerExited(const IInspectable& sender, const Windows::UI::Xaml::Input::PointerRoutedEventArgs& eventArgs);
|
||||
safe_void_coroutine _OnTabPointerReleasedCloseTab(IInspectable sender);
|
||||
|
||||
void _OnTabSelectionChanged(const IInspectable& sender, const Windows::UI::Xaml::Controls::SelectionChangedEventArgs& eventArgs);
|
||||
void _OnTabItemsChanged(const IInspectable& sender, const Windows::Foundation::Collections::IVectorChangedEventArgs& eventArgs);
|
||||
@@ -456,7 +466,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void _Find(const Tab& tab);
|
||||
|
||||
winrt::Microsoft::Terminal::Control::TermControl _CreateNewControlAndContent(const winrt::Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult& settings,
|
||||
winrt::Microsoft::Terminal::Control::TermControl _CreateNewControlAndContent(const winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult& settings,
|
||||
const winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection& connection);
|
||||
winrt::Microsoft::Terminal::Control::TermControl _SetupControl(const winrt::Microsoft::Terminal::Control::TermControl& term);
|
||||
winrt::Microsoft::Terminal::Control::TermControl _AttachControlToContent(const uint64_t& contentGuid);
|
||||
@@ -511,7 +521,7 @@ namespace winrt::TerminalApp::implementation
|
||||
winrt::Microsoft::Terminal::Settings::Model::Profile GetClosestProfileForDuplicationOfProfile(const winrt::Microsoft::Terminal::Settings::Model::Profile& profile) const noexcept;
|
||||
|
||||
bool _maybeElevate(const winrt::Microsoft::Terminal::Settings::Model::NewTerminalArgs& newTerminalArgs,
|
||||
const winrt::Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult& controlSettings,
|
||||
const winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult& controlSettings,
|
||||
const winrt::Microsoft::Terminal::Settings::Model::Profile& profile);
|
||||
void _OpenElevatedWT(winrt::Microsoft::Terminal::Settings::Model::NewTerminalArgs newTerminalArgs);
|
||||
|
||||
|
||||
@@ -127,11 +127,9 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
// TODO:GH#9800 - we used to be able to persist the color scheme that a
|
||||
// TermControl was initialized with, by name. With the change to having the
|
||||
// control own its own copy of its settings, this isn't possible anymore.
|
||||
//
|
||||
// We may be able to get around this by storing the Name in the Core::Scheme
|
||||
// object. That would work for schemes set by the Terminal, but not ones set
|
||||
// by VT, but that seems good enough.
|
||||
// control own its own copy of its settings, this wasn't possible anymore.
|
||||
// It probably is once again possible, but Dustin doesn't know how to undo
|
||||
// the damage done in the ControlSettings migration.
|
||||
|
||||
switch (kind)
|
||||
{
|
||||
@@ -279,7 +277,7 @@ namespace winrt::TerminalApp::implementation
|
||||
auto sounds{ _profile.BellSound() };
|
||||
if (sounds && sounds.Size() > 0)
|
||||
{
|
||||
winrt::hstring soundPath{ wil::ExpandEnvironmentStringsW<std::wstring>(sounds.GetAt(rand() % sounds.Size()).c_str()) };
|
||||
winrt::hstring soundPath{ sounds.GetAt(rand() % sounds.Size()).Resolved() };
|
||||
winrt::Windows::Foundation::Uri uri{ soundPath };
|
||||
_playBellSound(uri);
|
||||
}
|
||||
@@ -347,9 +345,9 @@ namespace winrt::TerminalApp::implementation
|
||||
const auto profile{ settings.FindProfile(_profile.Guid()) };
|
||||
_profile = profile ? profile : settings.ProfileDefaults();
|
||||
|
||||
if (const auto& settings{ _cache->TryLookup(_profile) })
|
||||
if (const auto settings{ _cache->TryLookup(_profile) })
|
||||
{
|
||||
_control.UpdateControlSettings(settings.DefaultSettings(), settings.UnfocusedSettings());
|
||||
_control.UpdateControlSettings(settings->DefaultSettings(), settings->UnfocusedSettings());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,22 +3,27 @@
|
||||
|
||||
#include "pch.h"
|
||||
#include "TerminalSettingsCache.h"
|
||||
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
namespace MUX = Microsoft::UI::Xaml;
|
||||
namespace WUX = Windows::UI::Xaml;
|
||||
namespace MTSM = Microsoft::Terminal::Settings::Model;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
TerminalSettingsCache::TerminalSettingsCache(const MTSM::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings)
|
||||
TerminalSettingsPair::TerminalSettingsPair(const winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult& result)
|
||||
{
|
||||
Reset(settings, bindings);
|
||||
result.DefaultSettings().try_as(_defaultSettings);
|
||||
result.UnfocusedSettings().try_as(_unfocusedSettings);
|
||||
}
|
||||
|
||||
MTSM::TerminalSettingsCreateResult TerminalSettingsCache::TryLookup(const MTSM::Profile& profile)
|
||||
TerminalSettingsCache::TerminalSettingsCache(const MTSM::CascadiaSettings& settings)
|
||||
{
|
||||
Reset(settings);
|
||||
}
|
||||
|
||||
std::optional<TerminalSettingsPair> TerminalSettingsCache::TryLookup(const MTSM::Profile& profile)
|
||||
{
|
||||
const auto found{ profileGuidSettingsMap.find(profile.Guid()) };
|
||||
// GH#2455: If there are any panes with controls that had been
|
||||
@@ -30,18 +35,17 @@ namespace winrt::TerminalApp::implementation
|
||||
auto& pair{ found->second };
|
||||
if (!pair.second)
|
||||
{
|
||||
pair.second = MTSM::TerminalSettings::CreateWithProfile(_settings, pair.first, _bindings);
|
||||
pair.second = winrt::Microsoft::Terminal::Settings::TerminalSettings::CreateWithProfile(_settings, pair.first);
|
||||
}
|
||||
return pair.second;
|
||||
return std::optional{ TerminalSettingsPair{ *pair.second } };
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void TerminalSettingsCache::Reset(const MTSM::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings)
|
||||
void TerminalSettingsCache::Reset(const MTSM::CascadiaSettings& settings)
|
||||
{
|
||||
_settings = settings;
|
||||
_bindings = bindings;
|
||||
|
||||
// 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.
|
||||
@@ -51,12 +55,12 @@ namespace winrt::TerminalApp::implementation
|
||||
profileGuidSettingsMap.reserve(allProfiles.Size() + 1);
|
||||
|
||||
// Include the Defaults profile for consideration
|
||||
profileGuidSettingsMap.insert_or_assign(profileDefaults.Guid(), std::pair{ profileDefaults, nullptr });
|
||||
profileGuidSettingsMap.insert_or_assign(profileDefaults.Guid(), std::pair{ profileDefaults, std::nullopt });
|
||||
for (const auto& newProfile : allProfiles)
|
||||
{
|
||||
// Avoid creating a TerminalSettings right now. They're not totally cheap, and we suspect that users with many
|
||||
// panes may not be using all of their profiles at the same time. Lazy evaluation is king!
|
||||
profileGuidSettingsMap.insert_or_assign(newProfile.Guid(), std::pair{ newProfile, nullptr });
|
||||
profileGuidSettingsMap.insert_or_assign(newProfile.Guid(), std::pair{ newProfile, std::nullopt });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,17 +16,34 @@ Abstract:
|
||||
#include "winrt/Microsoft.Terminal.Settings.Model.h"
|
||||
#include "winrt/TerminalApp.h"
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings
|
||||
{
|
||||
struct TerminalSettingsCreateResult;
|
||||
}
|
||||
|
||||
namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
class TerminalSettingsPair
|
||||
{
|
||||
public:
|
||||
TerminalSettingsPair(const winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult& result);
|
||||
|
||||
winrt::Microsoft::Terminal::Control::IControlSettings DefaultSettings() const { return _defaultSettings; };
|
||||
winrt::Microsoft::Terminal::Control::IControlSettings UnfocusedSettings() const { return _unfocusedSettings; };
|
||||
|
||||
private:
|
||||
winrt::Microsoft::Terminal::Control::IControlSettings _defaultSettings{ nullptr };
|
||||
winrt::Microsoft::Terminal::Control::IControlSettings _unfocusedSettings{ nullptr };
|
||||
};
|
||||
|
||||
struct TerminalSettingsCache
|
||||
{
|
||||
TerminalSettingsCache(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings);
|
||||
Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult TryLookup(const Microsoft::Terminal::Settings::Model::Profile& profile);
|
||||
void Reset(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings, const TerminalApp::AppKeyBindings& bindings);
|
||||
TerminalSettingsCache(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings);
|
||||
std::optional<TerminalSettingsPair> TryLookup(const Microsoft::Terminal::Settings::Model::Profile& profile);
|
||||
void Reset(const Microsoft::Terminal::Settings::Model::CascadiaSettings& settings);
|
||||
|
||||
private:
|
||||
Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr };
|
||||
TerminalApp::AppKeyBindings _bindings{ nullptr };
|
||||
std::unordered_map<winrt::guid, std::pair<Microsoft::Terminal::Settings::Model::Profile, Microsoft::Terminal::Settings::Model::TerminalSettingsCreateResult>> profileGuidSettingsMap;
|
||||
std::unordered_map<winrt::guid, std::pair<Microsoft::Terminal::Settings::Model::Profile, std::optional<winrt::Microsoft::Terminal::Settings::TerminalSettingsCreateResult>>> profileGuidSettingsMap;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "SettingsLoadEventArgs.g.cpp"
|
||||
#include "WindowProperties.g.cpp"
|
||||
|
||||
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
|
||||
|
||||
using namespace winrt::Windows::ApplicationModel;
|
||||
using namespace winrt::Windows::ApplicationModel::DataTransfer;
|
||||
using namespace winrt::Windows::Graphics::Display;
|
||||
@@ -613,11 +615,11 @@ 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{ TerminalSettings::CreateWithNewTerminalArgs(_settings, nullptr, nullptr) };
|
||||
const auto settings{ Settings::TerminalSettings::CreateWithNewTerminalArgs(_settings, nullptr) };
|
||||
|
||||
const til::size emptySize{};
|
||||
const auto commandlineSize = _appArgs ? _appArgs->ParsedArgs().GetSize().value_or(emptySize) : til::size{};
|
||||
proposedSize = TermControl::GetProposedDimensions(settings.DefaultSettings(),
|
||||
proposedSize = TermControl::GetProposedDimensions(*settings.DefaultSettings(),
|
||||
dpi,
|
||||
commandlineSize.width,
|
||||
commandlineSize.height);
|
||||
@@ -1048,6 +1050,11 @@ namespace winrt::TerminalApp::implementation
|
||||
// (or called TerminalWindow::Initialize)
|
||||
if (_appArgs->ExitCode() == 0)
|
||||
{
|
||||
// The existing logic (before this commit) strictly relied on
|
||||
// ValidateStartupCommands() only to be called for new windows.
|
||||
// It modifies the actions it stores.
|
||||
parsedArgs.ValidateStartupCommands();
|
||||
|
||||
// If the size of the arguments list is 1,
|
||||
// then it contains only the executable name and no other arguments.
|
||||
_hasCommandLineArguments = _appArgs->CommandlineRef().size() > 1;
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*++
|
||||
Copyright (c) Microsoft Corporation
|
||||
Licensed under the MIT license.
|
||||
--*/
|
||||
#pragma once
|
||||
#include "../../inc/cppwinrt_utils.h"
|
||||
#include "../../inc/ControlProperties.h"
|
||||
|
||||
#include <DefaultSettings.h>
|
||||
#include <conattrs.hpp>
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
struct ControlAppearance : public winrt::implements<ControlAppearance, Microsoft::Terminal::Core::ICoreAppearance, Microsoft::Terminal::Control::IControlAppearance>
|
||||
{
|
||||
#define SETTINGS_GEN(type, name, ...) WINRT_PROPERTY(type, name, __VA_ARGS__);
|
||||
CORE_APPEARANCE_SETTINGS(SETTINGS_GEN)
|
||||
CONTROL_APPEARANCE_SETTINGS(SETTINGS_GEN)
|
||||
#undef SETTINGS_GEN
|
||||
|
||||
private:
|
||||
// Color Table is special because it's an array
|
||||
std::array<winrt::Microsoft::Terminal::Core::Color, COLOR_TABLE_SIZE> _ColorTable;
|
||||
|
||||
public:
|
||||
winrt::Microsoft::Terminal::Core::Color GetColorTableEntry(int32_t index) noexcept
|
||||
{
|
||||
return _ColorTable.at(index);
|
||||
}
|
||||
void SetColorTableEntry(int32_t index,
|
||||
winrt::Microsoft::Terminal::Core::Color color) noexcept
|
||||
{
|
||||
_ColorTable.at(index) = color;
|
||||
}
|
||||
|
||||
ControlAppearance(Control::IControlAppearance appearance)
|
||||
{
|
||||
#define COPY_SETTING(type, name, ...) _##name = appearance.name();
|
||||
CORE_APPEARANCE_SETTINGS(COPY_SETTING)
|
||||
CONTROL_APPEARANCE_SETTINGS(COPY_SETTING)
|
||||
#undef COPY_SETTING
|
||||
|
||||
for (size_t i = 0; i < _ColorTable.size(); i++)
|
||||
{
|
||||
_ColorTable[i] = appearance.GetColorTableEntry(static_cast<int32_t>(i));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -19,10 +19,12 @@
|
||||
#include "../../renderer/base/renderer.hpp"
|
||||
#include "../../renderer/uia/UiaRenderer.hpp"
|
||||
#include "../../types/inc/CodepointWidthDetector.hpp"
|
||||
#include "../../types/inc/utils.hpp"
|
||||
|
||||
#include "ControlCore.g.cpp"
|
||||
#include "SelectionColor.g.cpp"
|
||||
|
||||
using namespace ::Microsoft::Console;
|
||||
using namespace ::Microsoft::Console::Types;
|
||||
using namespace ::Microsoft::Console::VirtualTerminal;
|
||||
using namespace ::Microsoft::Terminal::Core;
|
||||
@@ -89,7 +91,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return true;
|
||||
}();
|
||||
|
||||
_settings = winrt::make_self<implementation::ControlSettings>(settings, unfocusedAppearance);
|
||||
_settings = settings;
|
||||
_hasUnfocusedAppearance = static_cast<bool>(unfocusedAppearance);
|
||||
_unfocusedAppearance = _hasUnfocusedAppearance ? unfocusedAppearance : settings;
|
||||
_terminal = std::make_shared<::Microsoft::Terminal::Core::Terminal>();
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
|
||||
@@ -102,7 +106,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
});
|
||||
|
||||
// GH#8969: pre-seed working directory to prevent potential races
|
||||
_terminal->SetWorkingDirectory(_settings->StartingDirectory());
|
||||
_terminal->SetWorkingDirectory(_settings.StartingDirectory());
|
||||
|
||||
_terminal->SetCopyToClipboardCallback([this](wil::zwstring_view wstr) {
|
||||
WriteToClipboard.raise(*this, winrt::make<WriteToClipboardEventArgs>(winrt::hstring{ std::wstring_view{ wstr } }, std::string{}, std::string{}));
|
||||
@@ -265,9 +269,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
shared->updateScrollBar.reset();
|
||||
}
|
||||
|
||||
void ControlCore::AttachToNewControl(const Microsoft::Terminal::Control::IKeyBindings& keyBindings)
|
||||
void ControlCore::AttachToNewControl()
|
||||
{
|
||||
_settings->KeyBindings(keyBindings);
|
||||
_setupDispatcherAndCallbacks();
|
||||
const auto actualNewSize = _actualFont.GetSize();
|
||||
// Bubble this up, so our new control knows how big we want the font.
|
||||
@@ -399,10 +402,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
}
|
||||
|
||||
// Override the default width and height to match the size of the swapChainPanel
|
||||
_settings->InitialCols(width);
|
||||
_settings->InitialRows(height);
|
||||
const til::size viewportSize{ Utils::ClampToShortMax(width, 1),
|
||||
Utils::ClampToShortMax(height, 1) };
|
||||
|
||||
_terminal->CreateFromSettings(*_settings, *_renderer);
|
||||
// TODO:MSFT:20642297 - Support infinite scrollback here, if HistorySize is -1
|
||||
_terminal->Create(viewportSize, Utils::ClampToShortMax(_settings.HistorySize(), 0), *_renderer);
|
||||
_terminal->UpdateSettings(_settings);
|
||||
|
||||
// Tell the render engine to notify us when the swap chain changes.
|
||||
// We do this after we initially set the swapchain so as to avoid
|
||||
@@ -411,12 +416,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_renderEngineSwapChainChanged(handle);
|
||||
});
|
||||
|
||||
_renderEngine->SetRetroTerminalEffect(_settings->RetroTerminalEffect());
|
||||
_renderEngine->SetPixelShaderPath(_settings->PixelShaderPath());
|
||||
_renderEngine->SetPixelShaderImagePath(_settings->PixelShaderImagePath());
|
||||
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(_settings->GraphicsAPI()));
|
||||
_renderEngine->SetDisablePartialInvalidation(_settings->DisablePartialInvalidation());
|
||||
_renderEngine->SetSoftwareRendering(_settings->SoftwareRendering());
|
||||
_renderEngine->SetRetroTerminalEffect(_settings.RetroTerminalEffect());
|
||||
_renderEngine->SetPixelShaderPath(_settings.PixelShaderPath());
|
||||
_renderEngine->SetPixelShaderImagePath(_settings.PixelShaderImagePath());
|
||||
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(_settings.GraphicsAPI()));
|
||||
_renderEngine->SetDisablePartialInvalidation(_settings.DisablePartialInvalidation());
|
||||
_renderEngine->SetSoftwareRendering(_settings.SoftwareRendering());
|
||||
|
||||
_updateAntiAliasingMode();
|
||||
|
||||
@@ -573,7 +578,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_updateSelectionUI();
|
||||
return true;
|
||||
}
|
||||
else if (vkey == VK_TAB && !mods.IsAltPressed() && !mods.IsCtrlPressed() && _settings->DetectURLs())
|
||||
else if (vkey == VK_TAB && !mods.IsAltPressed() && !mods.IsCtrlPressed() && _settings.DetectURLs())
|
||||
{
|
||||
// [Shift +] Tab --> next/previous hyperlink
|
||||
const auto direction = mods.IsShiftPressed() ? ::Terminal::SearchDirection::Backward : ::Terminal::SearchDirection::Forward;
|
||||
@@ -600,7 +605,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
else if (vkey == VK_RETURN && !mods.IsCtrlPressed() && !mods.IsAltPressed())
|
||||
{
|
||||
// [Shift +] Enter --> copy text
|
||||
CopySelectionToClipboard(mods.IsShiftPressed(), false, _settings->CopyFormatting());
|
||||
CopySelectionToClipboard(mods.IsShiftPressed(), false, _settings.CopyFormatting());
|
||||
_terminal->ClearSelection();
|
||||
_updateSelectionUI();
|
||||
return true;
|
||||
@@ -758,7 +763,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_runtimeFocusedOpacity = focused ? newOpacity : _runtimeFocusedOpacity;
|
||||
|
||||
// Manually turn off acrylic if they turn off transparency.
|
||||
_runtimeUseAcrylic = newOpacity < 1.0f && _settings->UseAcrylic();
|
||||
_runtimeUseAcrylic = newOpacity < 1.0f && _settings.UseAcrylic();
|
||||
|
||||
// Update the renderer as well. It might need to fall back from
|
||||
// cleartype -> grayscale if the BG is transparent / acrylic.
|
||||
@@ -775,7 +780,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
void ControlCore::ToggleShaderEffects()
|
||||
{
|
||||
const auto path = _settings->PixelShaderPath();
|
||||
const auto path = _settings.PixelShaderPath();
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
// Originally, this action could be used to enable the retro effects
|
||||
// even when they're set to `false` in the settings. If the user didn't
|
||||
@@ -880,24 +885,26 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// - INVARIANT: This method can only be called if the caller DOES NOT HAVE writing lock on the terminal.
|
||||
void ControlCore::UpdateSettings(const IControlSettings& settings, const IControlAppearance& newAppearance)
|
||||
{
|
||||
_settings = winrt::make_self<implementation::ControlSettings>(settings, newAppearance);
|
||||
_settings = settings;
|
||||
_hasUnfocusedAppearance = static_cast<bool>(newAppearance);
|
||||
_unfocusedAppearance = _hasUnfocusedAppearance ? newAppearance : settings;
|
||||
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
|
||||
_builtinGlyphs = _settings->EnableBuiltinGlyphs();
|
||||
_colorGlyphs = _settings->EnableColorGlyphs();
|
||||
_cellWidth = CSSLengthPercentage::FromString(_settings->CellWidth().c_str());
|
||||
_cellHeight = CSSLengthPercentage::FromString(_settings->CellHeight().c_str());
|
||||
_builtinGlyphs = _settings.EnableBuiltinGlyphs();
|
||||
_colorGlyphs = _settings.EnableColorGlyphs();
|
||||
_cellWidth = CSSLengthPercentage::FromString(_settings.CellWidth().c_str());
|
||||
_cellHeight = CSSLengthPercentage::FromString(_settings.CellHeight().c_str());
|
||||
_runtimeOpacity = std::nullopt;
|
||||
_runtimeFocusedOpacity = std::nullopt;
|
||||
|
||||
// Manually turn off acrylic if they turn off transparency.
|
||||
_runtimeUseAcrylic = _settings->Opacity() < 1.0 && _settings->UseAcrylic();
|
||||
_runtimeUseAcrylic = _settings.Opacity() < 1.0 && _settings.UseAcrylic();
|
||||
|
||||
const auto sizeChanged = _setFontSizeUnderLock(_settings->FontSize());
|
||||
const auto sizeChanged = _setFontSizeUnderLock(_settings.FontSize());
|
||||
|
||||
// Update the terminal core with its new Core settings
|
||||
_terminal->UpdateSettings(*_settings);
|
||||
_terminal->UpdateSettings(_settings);
|
||||
|
||||
if (!_initializedTerminal.load(std::memory_order_relaxed))
|
||||
{
|
||||
@@ -906,9 +913,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return;
|
||||
}
|
||||
|
||||
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(_settings->GraphicsAPI()));
|
||||
_renderEngine->SetDisablePartialInvalidation(_settings->DisablePartialInvalidation());
|
||||
_renderEngine->SetSoftwareRendering(_settings->SoftwareRendering());
|
||||
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(_settings.GraphicsAPI()));
|
||||
_renderEngine->SetDisablePartialInvalidation(_settings.DisablePartialInvalidation());
|
||||
_renderEngine->SetSoftwareRendering(_settings.SoftwareRendering());
|
||||
// Inform the renderer of our opacity
|
||||
_renderEngine->EnableTransparentBackground(_isBackgroundTransparent());
|
||||
|
||||
@@ -929,30 +936,34 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
void ControlCore::ApplyAppearance(const bool focused)
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
const auto& newAppearance{ focused ? _settings->FocusedAppearance() : _settings->UnfocusedAppearance() };
|
||||
const IControlAppearance newAppearance{ focused ? _settings : _unfocusedAppearance };
|
||||
// Update the terminal core with its new Core settings
|
||||
_terminal->UpdateAppearance(*newAppearance);
|
||||
_terminal->UpdateAppearance(newAppearance);
|
||||
if ((focused || !_hasUnfocusedAppearance) && _focusedColorSchemeOverride)
|
||||
{
|
||||
_terminal->UpdateColorScheme(_focusedColorSchemeOverride);
|
||||
}
|
||||
|
||||
// Update AtlasEngine settings under the lock
|
||||
if (_renderEngine)
|
||||
{
|
||||
// Update AtlasEngine settings under the lock
|
||||
_renderEngine->SetRetroTerminalEffect(newAppearance->RetroTerminalEffect());
|
||||
_renderEngine->SetPixelShaderPath(newAppearance->PixelShaderPath());
|
||||
_renderEngine->SetPixelShaderImagePath(newAppearance->PixelShaderImagePath());
|
||||
_renderEngine->SetRetroTerminalEffect(newAppearance.RetroTerminalEffect());
|
||||
_renderEngine->SetPixelShaderPath(newAppearance.PixelShaderPath());
|
||||
_renderEngine->SetPixelShaderImagePath(newAppearance.PixelShaderImagePath());
|
||||
|
||||
// Incase EnableUnfocusedAcrylic is disabled and Focused Acrylic is set to true,
|
||||
// the terminal should ignore the unfocused opacity from settings.
|
||||
// The Focused Opacity from settings should be ignored if overridden at runtime.
|
||||
const auto useFocusedRuntimeOpacity = focused || (!_settings->EnableUnfocusedAcrylic() && UseAcrylic());
|
||||
const auto newOpacity = useFocusedRuntimeOpacity ? FocusedOpacity() : newAppearance->Opacity();
|
||||
const auto useFocusedRuntimeOpacity = focused || (!_settings.EnableUnfocusedAcrylic() && UseAcrylic());
|
||||
const auto newOpacity = useFocusedRuntimeOpacity ? FocusedOpacity() : newAppearance.Opacity();
|
||||
_setOpacity(newOpacity, focused);
|
||||
|
||||
// No need to update Acrylic if UnfocusedAcrylic is disabled
|
||||
if (_settings->EnableUnfocusedAcrylic())
|
||||
if (_settings.EnableUnfocusedAcrylic())
|
||||
{
|
||||
// Manually turn off acrylic if they turn off transparency.
|
||||
_runtimeUseAcrylic = Opacity() < 1.0 && newAppearance->UseAcrylic();
|
||||
_runtimeUseAcrylic = Opacity() < 1.0 && newAppearance.UseAcrylic();
|
||||
}
|
||||
|
||||
// Update the renderer as well. It might need to fall back from
|
||||
@@ -974,24 +985,68 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
Control::IControlSettings ControlCore::Settings()
|
||||
{
|
||||
return *_settings;
|
||||
return _settings;
|
||||
}
|
||||
|
||||
Control::IControlAppearance ControlCore::FocusedAppearance() const
|
||||
{
|
||||
return *_settings->FocusedAppearance();
|
||||
return _settings;
|
||||
}
|
||||
|
||||
Control::IControlAppearance ControlCore::UnfocusedAppearance() const
|
||||
{
|
||||
return *_settings->UnfocusedAppearance();
|
||||
return _unfocusedAppearance;
|
||||
}
|
||||
|
||||
void ControlCore::ApplyPreviewColorScheme(const Core::ICoreScheme& scheme)
|
||||
{
|
||||
const auto lock = _terminal->LockForReading();
|
||||
auto& renderSettings = _terminal->GetRenderSettings();
|
||||
if (!_stashedColorScheme)
|
||||
{
|
||||
_stashedColorScheme = std::make_unique_for_overwrite<StashedColorScheme>();
|
||||
*_stashedColorScheme = {
|
||||
.scheme = renderSettings.GetColorTable(),
|
||||
.foregroundAlias = renderSettings.GetColorAliasIndex(ColorAlias::DefaultForeground),
|
||||
.backgroundAlias = renderSettings.GetColorAliasIndex(ColorAlias::DefaultBackground),
|
||||
};
|
||||
}
|
||||
_terminal->UpdateColorScheme(scheme);
|
||||
_renderer->TriggerRedrawAll(true);
|
||||
}
|
||||
|
||||
void ControlCore::ResetPreviewColorScheme()
|
||||
{
|
||||
if (_stashedColorScheme)
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
auto& renderSettings = _terminal->GetRenderSettings();
|
||||
decltype(auto) stashedScheme{ *_stashedColorScheme.get() };
|
||||
for (size_t i = 0; i < TextColor::TABLE_SIZE; ++i)
|
||||
{
|
||||
renderSettings.SetColorTableEntry(i, til::at(stashedScheme.scheme, i));
|
||||
}
|
||||
renderSettings.SetColorAliasIndex(ColorAlias::DefaultForeground, stashedScheme.foregroundAlias);
|
||||
renderSettings.SetColorAliasIndex(ColorAlias::DefaultBackground, stashedScheme.backgroundAlias);
|
||||
_renderer->TriggerRedrawAll(true);
|
||||
}
|
||||
_stashedColorScheme.reset();
|
||||
}
|
||||
|
||||
void ControlCore::SetOverrideColorScheme(const Core::ICoreScheme& scheme)
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
_focusedColorSchemeOverride = scheme;
|
||||
|
||||
_terminal->UpdateColorScheme(scheme ? scheme : _settings.as<Core::ICoreScheme>());
|
||||
_renderer->TriggerRedrawAll(true);
|
||||
}
|
||||
|
||||
void ControlCore::_updateAntiAliasingMode()
|
||||
{
|
||||
D2D1_TEXT_ANTIALIAS_MODE mode;
|
||||
// Update AtlasEngine's AntialiasingMode
|
||||
switch (_settings->AntialiasingMode())
|
||||
switch (_settings.AntialiasingMode())
|
||||
{
|
||||
case TextAntialiasingMode::Cleartype:
|
||||
mode = D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE;
|
||||
@@ -1024,7 +1079,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
if (_renderEngine)
|
||||
{
|
||||
static constexpr auto cloneMap = [](const IFontFeatureMap& map) {
|
||||
static constexpr auto cloneMap = [](const auto& map) {
|
||||
std::unordered_map<std::wstring_view, float> clone;
|
||||
if (map)
|
||||
{
|
||||
@@ -1037,8 +1092,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return clone;
|
||||
};
|
||||
|
||||
const auto fontFeatures = _settings->FontFeatures();
|
||||
const auto fontAxes = _settings->FontAxes();
|
||||
const auto fontFeatures = _settings.FontFeatures();
|
||||
const auto fontAxes = _settings.FontAxes();
|
||||
const auto featureMap = cloneMap(fontFeatures);
|
||||
const auto axesMap = cloneMap(fontAxes);
|
||||
|
||||
@@ -1062,8 +1117,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
// Make sure we have a non-zero font size
|
||||
const auto newSize = std::max(fontSize, 1.0f);
|
||||
const auto fontFace = _settings->FontFace();
|
||||
const auto fontWeight = _settings->FontWeight();
|
||||
const auto fontFace = _settings.FontFace();
|
||||
const auto fontWeight = _settings.FontWeight();
|
||||
_desiredFont = { fontFace, 0, fontWeight.Weight, newSize, CP_UTF8 };
|
||||
_actualFont = { fontFace, 0, fontWeight.Weight, _desiredFont.GetEngineSize(), CP_UTF8, false };
|
||||
|
||||
@@ -1085,7 +1140,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
|
||||
if (_setFontSizeUnderLock(_settings->FontSize()))
|
||||
if (_setFontSizeUnderLock(_settings.FontSize()))
|
||||
{
|
||||
_refreshSizeUnderLock();
|
||||
}
|
||||
@@ -1642,7 +1697,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
bool ControlCore::CopyOnSelect() const
|
||||
{
|
||||
return _settings->CopyOnSelect();
|
||||
return _settings.CopyOnSelect();
|
||||
}
|
||||
|
||||
winrt::hstring ControlCore::SelectedText(bool trimTrailingWhitespace) const
|
||||
@@ -1999,7 +2054,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_terminal->MultiClickSelection(terminalPosition, mode);
|
||||
selectionNeedsToBeCopied = true;
|
||||
}
|
||||
else if (_settings->RepositionCursorWithMouse() && !selectionNeedsToBeCopied) // Don't reposition cursor if this is part of a selection operation
|
||||
else if (_settings.RepositionCursorWithMouse() && !selectionNeedsToBeCopied) // Don't reposition cursor if this is part of a selection operation
|
||||
{
|
||||
_repositionCursorWithMouse(terminalPosition);
|
||||
}
|
||||
@@ -2333,109 +2388,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_cachedQuickFixes = quickFixes;
|
||||
}
|
||||
|
||||
Core::Scheme ControlCore::ColorScheme() const noexcept
|
||||
{
|
||||
Core::Scheme s;
|
||||
|
||||
// This part is definitely a hack.
|
||||
//
|
||||
// This function is usually used by the "Preview Color Scheme"
|
||||
// functionality in TerminalPage. If we've got an unfocused appearance,
|
||||
// then we've applied that appearance before this is even getting called
|
||||
// (because the command palette is open with focus on top of us). If we
|
||||
// return the _current_ colors now, we'll return out the _unfocused_
|
||||
// colors. If we do that, and the user dismisses the command palette,
|
||||
// then the scheme that will get restored is the _unfocused_ one, which
|
||||
// is not what we want.
|
||||
//
|
||||
// So if that's the case, then let's grab the colors from the focused
|
||||
// appearance as the scheme instead. We'll lose any current runtime
|
||||
// changes to the color table, but those were already blown away when we
|
||||
// switched to an unfocused appearance.
|
||||
//
|
||||
// IF WE DON'T HAVE AN UNFOCUSED APPEARANCE: then just ask the Terminal
|
||||
// for its current color table. That way, we can restore those colors
|
||||
// back.
|
||||
if (HasUnfocusedAppearance())
|
||||
{
|
||||
s.Foreground = _settings->FocusedAppearance()->DefaultForeground();
|
||||
s.Background = _settings->FocusedAppearance()->DefaultBackground();
|
||||
|
||||
s.CursorColor = _settings->FocusedAppearance()->CursorColor();
|
||||
|
||||
s.Black = _settings->FocusedAppearance()->GetColorTableEntry(0);
|
||||
s.Red = _settings->FocusedAppearance()->GetColorTableEntry(1);
|
||||
s.Green = _settings->FocusedAppearance()->GetColorTableEntry(2);
|
||||
s.Yellow = _settings->FocusedAppearance()->GetColorTableEntry(3);
|
||||
s.Blue = _settings->FocusedAppearance()->GetColorTableEntry(4);
|
||||
s.Purple = _settings->FocusedAppearance()->GetColorTableEntry(5);
|
||||
s.Cyan = _settings->FocusedAppearance()->GetColorTableEntry(6);
|
||||
s.White = _settings->FocusedAppearance()->GetColorTableEntry(7);
|
||||
s.BrightBlack = _settings->FocusedAppearance()->GetColorTableEntry(8);
|
||||
s.BrightRed = _settings->FocusedAppearance()->GetColorTableEntry(9);
|
||||
s.BrightGreen = _settings->FocusedAppearance()->GetColorTableEntry(10);
|
||||
s.BrightYellow = _settings->FocusedAppearance()->GetColorTableEntry(11);
|
||||
s.BrightBlue = _settings->FocusedAppearance()->GetColorTableEntry(12);
|
||||
s.BrightPurple = _settings->FocusedAppearance()->GetColorTableEntry(13);
|
||||
s.BrightCyan = _settings->FocusedAppearance()->GetColorTableEntry(14);
|
||||
s.BrightWhite = _settings->FocusedAppearance()->GetColorTableEntry(15);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto lock = _terminal->LockForReading();
|
||||
s = _terminal->GetColorScheme();
|
||||
}
|
||||
|
||||
// This might be a tad bit of a hack. This event only gets called by set
|
||||
// color scheme / preview color scheme, and in that case, we know the
|
||||
// control _is_ focused.
|
||||
s.SelectionBackground = _settings->FocusedAppearance()->SelectionBackground();
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Apply the given color scheme to this control. We'll take the colors out
|
||||
// of it and apply them to our focused appearance, and update the terminal
|
||||
// buffer with the new color table.
|
||||
// - This is here to support the Set Color Scheme action, and the ability to
|
||||
// preview schemes in the control.
|
||||
// Arguments:
|
||||
// - scheme: the collection of colors to apply.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void ControlCore::ColorScheme(const Core::Scheme& scheme)
|
||||
{
|
||||
_settings->FocusedAppearance()->DefaultForeground(scheme.Foreground);
|
||||
_settings->FocusedAppearance()->DefaultBackground(scheme.Background);
|
||||
_settings->FocusedAppearance()->CursorColor(scheme.CursorColor);
|
||||
_settings->FocusedAppearance()->SelectionBackground(scheme.SelectionBackground);
|
||||
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(0, scheme.Black);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(1, scheme.Red);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(2, scheme.Green);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(3, scheme.Yellow);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(4, scheme.Blue);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(5, scheme.Purple);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(6, scheme.Cyan);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(7, scheme.White);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(8, scheme.BrightBlack);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(9, scheme.BrightRed);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(10, scheme.BrightGreen);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(11, scheme.BrightYellow);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(12, scheme.BrightBlue);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(13, scheme.BrightPurple);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(14, scheme.BrightCyan);
|
||||
_settings->FocusedAppearance()->SetColorTableEntry(15, scheme.BrightWhite);
|
||||
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
_terminal->ApplyScheme(scheme);
|
||||
_renderer->TriggerRedrawAll(true);
|
||||
}
|
||||
|
||||
bool ControlCore::HasUnfocusedAppearance() const
|
||||
{
|
||||
return _settings->HasUnfocusedAppearance();
|
||||
return _hasUnfocusedAppearance;
|
||||
}
|
||||
|
||||
void ControlCore::AdjustOpacity(const float opacityAdjust, const bool relative)
|
||||
@@ -2523,7 +2478,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// then the renderer should not render "default background" text with a
|
||||
// fully opaque background. Doing that would cover up our nice
|
||||
// transparency, or our acrylic, or our image.
|
||||
return Opacity() < 1.0f || !_settings->BackgroundImage().empty() || _settings->UseBackgroundImageForWindow();
|
||||
return Opacity() < 1.0f || !_settings.BackgroundImage().empty() || _settings.UseBackgroundImageForWindow();
|
||||
}
|
||||
|
||||
uint64_t ControlCore::OwningHwnd()
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "SelectionColor.g.h"
|
||||
#include "CommandHistoryContext.g.h"
|
||||
|
||||
#include "ControlSettings.h"
|
||||
#include "../../audio/midi/MidiAudio.hpp"
|
||||
#include "../../buffer/out/search.h"
|
||||
#include "../../cascadia/TerminalCore/Terminal.hpp"
|
||||
@@ -100,12 +99,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
Control::IControlAppearance UnfocusedAppearance() const;
|
||||
bool HasUnfocusedAppearance() const;
|
||||
|
||||
winrt::Microsoft::Terminal::Core::Scheme ColorScheme() const noexcept;
|
||||
void ColorScheme(const winrt::Microsoft::Terminal::Core::Scheme& scheme);
|
||||
void ApplyPreviewColorScheme(const Core::ICoreScheme&);
|
||||
void ResetPreviewColorScheme();
|
||||
void SetOverrideColorScheme(const Core::ICoreScheme&);
|
||||
|
||||
::Microsoft::Console::Render::Renderer* GetRenderer() const noexcept;
|
||||
uint64_t SwapChainHandle() const;
|
||||
void AttachToNewControl(const Microsoft::Terminal::Control::IKeyBindings& keyBindings);
|
||||
void AttachToNewControl();
|
||||
|
||||
void SizeChanged(const float width, const float height);
|
||||
void ScaleChanged(const float scale);
|
||||
@@ -268,9 +268,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
void PreviewInput(std::wstring_view input);
|
||||
|
||||
RUNTIME_SETTING(float, Opacity, _settings->Opacity());
|
||||
RUNTIME_SETTING(float, Opacity, _settings.Opacity());
|
||||
RUNTIME_SETTING(float, FocusedOpacity, FocusedAppearance().Opacity());
|
||||
RUNTIME_SETTING(bool, UseAcrylic, _settings->UseAcrylic());
|
||||
RUNTIME_SETTING(bool, UseAcrylic, _settings.UseAcrylic());
|
||||
|
||||
// -------------------------------- WinRT Events ---------------------------------
|
||||
// clang-format off
|
||||
@@ -408,7 +408,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
// Other stuff.
|
||||
winrt::Windows::System::DispatcherQueue _dispatcher{ nullptr };
|
||||
winrt::com_ptr<ControlSettings> _settings{ nullptr };
|
||||
IControlSettings _settings{ nullptr };
|
||||
bool _hasUnfocusedAppearance{ false };
|
||||
IControlAppearance _unfocusedAppearance{ nullptr };
|
||||
Core::ICoreScheme _focusedColorSchemeOverride{ nullptr };
|
||||
til::point _contextMenuBufferPosition{ 0, 0 };
|
||||
Windows::Foundation::Collections::IVector<hstring> _cachedQuickFixes{ nullptr };
|
||||
::Search _searcher;
|
||||
@@ -420,6 +423,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
bool _isReadOnly{ false };
|
||||
bool _closing{ false };
|
||||
|
||||
struct StashedColorScheme
|
||||
{
|
||||
std::array<COLORREF, TextColor::TABLE_SIZE> scheme;
|
||||
size_t foregroundAlias;
|
||||
size_t backgroundAlias;
|
||||
};
|
||||
std::unique_ptr<StashedColorScheme> _stashedColorScheme;
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// These are ordered last to ensure they're destroyed first.
|
||||
// This ensures that their respective contents stops taking dependency on the above.
|
||||
|
||||
@@ -104,6 +104,11 @@ namespace Microsoft.Terminal.Control
|
||||
Boolean HasUnfocusedAppearance();
|
||||
void SetHighContrastMode(Boolean enabled);
|
||||
|
||||
void ApplyPreviewColorScheme(Microsoft.Terminal.Core.ICoreScheme scheme);
|
||||
void ResetPreviewColorScheme();
|
||||
|
||||
void SetOverrideColorScheme(Microsoft.Terminal.Core.ICoreScheme scheme);
|
||||
|
||||
UInt64 SwapChainHandle { get; };
|
||||
|
||||
Windows.Foundation.Size FontSize { get; };
|
||||
|
||||
@@ -84,9 +84,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_core->Detach();
|
||||
}
|
||||
|
||||
void ControlInteractivity::AttachToNewControl(const Microsoft::Terminal::Control::IKeyBindings& keyBindings)
|
||||
void ControlInteractivity::AttachToNewControl()
|
||||
{
|
||||
_core->AttachToNewControl(keyBindings);
|
||||
_core->AttachToNewControl();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -485,7 +485,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// - modifiers: The modifiers pressed during this event, in the form of a VirtualKeyModifiers
|
||||
// - delta: the mouse wheel delta that triggered this event.
|
||||
bool ControlInteractivity::MouseWheel(const ::Microsoft::Terminal::Core::ControlKeyStates modifiers,
|
||||
const int32_t delta,
|
||||
const Core::Point delta,
|
||||
const Core::Point pixelPosition,
|
||||
const Control::MouseButtonState buttonState)
|
||||
{
|
||||
@@ -506,9 +506,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// PointerPoint to work with. So, we're just going to do a
|
||||
// mousewheel event manually
|
||||
return _sendMouseEventHelper(terminalPosition,
|
||||
WM_MOUSEWHEEL,
|
||||
delta.Y != 0 ? WM_MOUSEWHEEL : WM_MOUSEHWHEEL,
|
||||
modifiers,
|
||||
::base::saturated_cast<short>(delta),
|
||||
::base::saturated_cast<short>(delta.Y != 0 ? delta.Y : delta.X),
|
||||
buttonState);
|
||||
}
|
||||
|
||||
@@ -517,15 +517,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
if (ctrlPressed && shiftPressed && _core->Settings().ScrollToChangeOpacity())
|
||||
{
|
||||
_mouseTransparencyHandler(delta);
|
||||
_mouseTransparencyHandler(delta.Y);
|
||||
}
|
||||
else if (ctrlPressed && !shiftPressed && _core->Settings().ScrollToZoom())
|
||||
{
|
||||
_mouseZoomHandler(delta);
|
||||
_mouseZoomHandler(delta.Y);
|
||||
}
|
||||
else
|
||||
{
|
||||
_mouseScrollHandler(delta, pixelPosition, WI_IsFlagSet(buttonState, MouseButtonState::IsLeftButtonDown));
|
||||
_mouseScrollHandler(delta.Y, pixelPosition, WI_IsFlagSet(buttonState, MouseButtonState::IsLeftButtonDown));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -659,7 +659,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return _core->IsVtMouseModeEnabled();
|
||||
}
|
||||
|
||||
bool ControlInteractivity::_shouldSendAlternateScroll(const ::Microsoft::Terminal::Core::ControlKeyStates modifiers, const int32_t delta)
|
||||
bool ControlInteractivity::_shouldSendAlternateScroll(const ::Microsoft::Terminal::Core::ControlKeyStates modifiers, const Core::Point delta)
|
||||
{
|
||||
// If the user is holding down Shift, suppress mouse events
|
||||
// TODO GH#4875: disable/customize this functionality
|
||||
@@ -667,7 +667,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return _core->ShouldSendAlternateScroll(WM_MOUSEWHEEL, delta);
|
||||
if (delta.Y != 0)
|
||||
{
|
||||
return _core->ShouldSendAlternateScroll(WM_MOUSEWHEEL, delta.Y);
|
||||
}
|
||||
else
|
||||
{
|
||||
return _core->ShouldSendAlternateScroll(WM_MOUSEHWHEEL, delta.X);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
void TouchReleased();
|
||||
|
||||
bool MouseWheel(const ::Microsoft::Terminal::Core::ControlKeyStates modifiers,
|
||||
const int32_t delta,
|
||||
const Core::Point delta,
|
||||
const Core::Point pixelPosition,
|
||||
const Control::MouseButtonState state);
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
void SetEndSelectionPoint(const Core::Point pixelPosition);
|
||||
|
||||
uint64_t Id();
|
||||
void AttachToNewControl(const Microsoft::Terminal::Control::IKeyBindings& keyBindings);
|
||||
void AttachToNewControl();
|
||||
|
||||
til::typed_event<IInspectable, Control::OpenHyperlinkEventArgs> OpenHyperlink;
|
||||
til::typed_event<IInspectable, Control::PasteFromClipboardEventArgs> PasteFromClipboard;
|
||||
@@ -153,7 +153,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
void _hyperlinkHandler(const std::wstring_view uri);
|
||||
bool _canSendVTMouseInput(const ::Microsoft::Terminal::Core::ControlKeyStates modifiers);
|
||||
bool _shouldSendAlternateScroll(const ::Microsoft::Terminal::Core::ControlKeyStates modifiers, const int32_t delta);
|
||||
bool _shouldSendAlternateScroll(const ::Microsoft::Terminal::Core::ControlKeyStates modifiers, const Core::Point delta);
|
||||
|
||||
til::point _getTerminalPosition(const til::point pixelPosition, bool roundToNearestCell);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Microsoft.Terminal.Control
|
||||
|
||||
UInt64 Id { get; };
|
||||
|
||||
void AttachToNewControl(Microsoft.Terminal.Control.IKeyBindings keyBindings);
|
||||
void AttachToNewControl();
|
||||
void Detach();
|
||||
|
||||
void Close();
|
||||
@@ -60,7 +60,7 @@ namespace Microsoft.Terminal.Control
|
||||
void TouchReleased();
|
||||
|
||||
Boolean MouseWheel(Microsoft.Terminal.Core.ControlKeyStates modifiers,
|
||||
Int32 delta,
|
||||
Microsoft.Terminal.Core.Point delta,
|
||||
Microsoft.Terminal.Core.Point pixelPosition,
|
||||
MouseButtonState state);
|
||||
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
/*++
|
||||
Copyright (c) Microsoft Corporation
|
||||
Licensed under the MIT license.
|
||||
--*/
|
||||
#pragma once
|
||||
#include "../../inc/cppwinrt_utils.h"
|
||||
#include "../../inc/ControlProperties.h"
|
||||
|
||||
#include <DefaultSettings.h>
|
||||
#include <conattrs.hpp>
|
||||
#include "ControlAppearance.h"
|
||||
|
||||
using IFontFeatureMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, float>;
|
||||
using IFontAxesMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, float>;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
struct ControlSettings : public winrt::implements<ControlSettings, Microsoft::Terminal::Control::IControlSettings, Microsoft::Terminal::Control::IControlAppearance, Microsoft::Terminal::Core::ICoreSettings, Microsoft::Terminal::Core::ICoreAppearance>
|
||||
{
|
||||
// Getters and setters for each *Setting member. We're not using
|
||||
// WINRT_PROPERTY for these, because they actually exist inside the
|
||||
// _focusedAppearance member. We don't need to reserve another member to
|
||||
// hold them.
|
||||
#define SETTINGS_GEN(type, name, ...) WINRT_PROPERTY(type, name, __VA_ARGS__);
|
||||
CORE_SETTINGS(SETTINGS_GEN)
|
||||
CONTROL_SETTINGS(SETTINGS_GEN)
|
||||
#undef SETTINGS_GEN
|
||||
|
||||
private:
|
||||
winrt::com_ptr<ControlAppearance> _unfocusedAppearance{ nullptr };
|
||||
winrt::com_ptr<ControlAppearance> _focusedAppearance{ nullptr };
|
||||
bool _hasUnfocusedAppearance{ false };
|
||||
|
||||
public:
|
||||
ControlSettings(const Control::IControlSettings& settings,
|
||||
const Control::IControlAppearance& unfocusedAppearance)
|
||||
{
|
||||
_hasUnfocusedAppearance = unfocusedAppearance != nullptr;
|
||||
|
||||
_focusedAppearance = winrt::make_self<implementation::ControlAppearance>(settings);
|
||||
_unfocusedAppearance = unfocusedAppearance ?
|
||||
winrt::make_self<implementation::ControlAppearance>(unfocusedAppearance) :
|
||||
_focusedAppearance;
|
||||
|
||||
// Copy every value from the passed in settings, into us.
|
||||
#define COPY_SETTING(type, name, ...) _##name = settings.name();
|
||||
CORE_SETTINGS(COPY_SETTING)
|
||||
CONTROL_SETTINGS(COPY_SETTING)
|
||||
#undef COPY_SETTING
|
||||
}
|
||||
|
||||
winrt::com_ptr<ControlAppearance> UnfocusedAppearance() { return _unfocusedAppearance; }
|
||||
winrt::com_ptr<ControlAppearance> FocusedAppearance() { return _focusedAppearance; }
|
||||
bool HasUnfocusedAppearance() { return _hasUnfocusedAppearance; }
|
||||
|
||||
// Getters and setters for each Appearance member. We're not using
|
||||
// WINRT_PROPERTY for these, because they actually exist inside the
|
||||
// _focusedAppearance member. We don't need to reserve another member to
|
||||
// hold them.
|
||||
//
|
||||
// The Appearance members (including GetColorTableEntry below) are used
|
||||
// when this ControlSettings is cast to a IControlAppearance or
|
||||
// ICoreAppearance. In those cases, we'll always return the Focused
|
||||
// appearance's version of the member. Callers who care about which
|
||||
// appearance is being used should be more careful. Fortunately, this
|
||||
// situation is generally only used when a control is first created, or
|
||||
// when calling UpdateSettings.
|
||||
#define APPEARANCE_GEN(type, name, ...) \
|
||||
type name() const noexcept \
|
||||
{ \
|
||||
return _focusedAppearance->name(); \
|
||||
} \
|
||||
void name(const type& value) noexcept \
|
||||
{ \
|
||||
_focusedAppearance->name(value); \
|
||||
}
|
||||
|
||||
CORE_APPEARANCE_SETTINGS(APPEARANCE_GEN)
|
||||
CONTROL_APPEARANCE_SETTINGS(APPEARANCE_GEN)
|
||||
#undef APPEARANCE_GEN
|
||||
|
||||
winrt::Microsoft::Terminal::Core::Color GetColorTableEntry(int32_t index) noexcept
|
||||
{
|
||||
return _focusedAppearance->GetColorTableEntry(index);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "IKeyBindings.idl";
|
||||
import "IControlAppearance.idl";
|
||||
import "EventArgs.idl";
|
||||
|
||||
@@ -53,8 +52,6 @@ namespace Microsoft.Terminal.Control
|
||||
String CellWidth { get; };
|
||||
String CellHeight { get; };
|
||||
|
||||
Microsoft.Terminal.Control.IKeyBindings KeyBindings { get; };
|
||||
|
||||
Boolean CopyOnSelect { get; };
|
||||
Microsoft.Terminal.Control.CopyFormat CopyFormatting { get; };
|
||||
Boolean FocusFollowMouse { get; };
|
||||
|
||||
@@ -50,8 +50,6 @@ namespace Microsoft.Terminal.Control
|
||||
|
||||
Microsoft.Terminal.TerminalConnection.ConnectionState ConnectionState { get; };
|
||||
|
||||
Microsoft.Terminal.Core.Scheme ColorScheme { get; set; };
|
||||
|
||||
UInt64 OwningHwnd;
|
||||
|
||||
void AddMark(ScrollMark mark);
|
||||
|
||||
@@ -11,6 +11,6 @@ namespace Microsoft.Terminal.Control
|
||||
[uuid("65b8b8c5-988f-43ff-aba9-e89368da1598")]
|
||||
interface IMouseWheelListener
|
||||
{
|
||||
Boolean OnMouseWheel(Windows.Foundation.Point coord, Int32 delta, Boolean leftButtonDown, Boolean midButtonDown, Boolean rightButtonDown);
|
||||
Boolean OnMouseWheel(Windows.Foundation.Point coord, Microsoft.Terminal.Core.Point delta, Boolean leftButtonDown, Boolean midButtonDown, Boolean rightButtonDown);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,25 +487,22 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// Function Description:
|
||||
// - Static helper for building a new TermControl from an already existing
|
||||
// content. We'll attach the existing swapchain to this new control's
|
||||
// SwapChainPanel. The IKeyBindings might belong to a non-agile object on
|
||||
// a new thread, so we'll hook up the core to these new bindings.
|
||||
// SwapChainPanel.
|
||||
// Arguments:
|
||||
// - content: The preexisting ControlInteractivity to connect to.
|
||||
// - keybindings: The new IKeyBindings instance to use for this control.
|
||||
// Return Value:
|
||||
// - The newly constructed TermControl.
|
||||
Control::TermControl TermControl::NewControlByAttachingContent(Control::ControlInteractivity content,
|
||||
const Microsoft::Terminal::Control::IKeyBindings& keyBindings)
|
||||
Control::TermControl TermControl::NewControlByAttachingContent(Control::ControlInteractivity content)
|
||||
{
|
||||
const auto term{ winrt::make_self<TermControl>(content) };
|
||||
term->_initializeForAttach(keyBindings);
|
||||
term->_initializeForAttach();
|
||||
return *term;
|
||||
}
|
||||
|
||||
void TermControl::_initializeForAttach(const Microsoft::Terminal::Control::IKeyBindings& keyBindings)
|
||||
void TermControl::_initializeForAttach()
|
||||
{
|
||||
_AttachDxgiSwapChainToXaml(reinterpret_cast<HANDLE>(_core.SwapChainHandle()));
|
||||
_interactivity.AttachToNewControl(keyBindings);
|
||||
_interactivity.AttachToNewControl();
|
||||
|
||||
// Initialize the terminal only once the swapchainpanel is loaded - that
|
||||
// way, we'll be able to query the real pixel size it got on layout
|
||||
@@ -1848,13 +1845,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return true;
|
||||
}
|
||||
|
||||
auto bindings = _core.Settings().KeyBindings();
|
||||
if (!bindings)
|
||||
if (!_keyBindings)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto success = bindings.TryKeyChord({
|
||||
auto success = _keyBindings.TryKeyChord({
|
||||
modifiers.IsCtrlPressed(),
|
||||
modifiers.IsAltPressed(),
|
||||
modifiers.IsShiftPressed(),
|
||||
@@ -2164,15 +2160,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
RestorePointerCursor.raise(*this, nullptr);
|
||||
|
||||
const auto point = args.GetCurrentPoint(*this);
|
||||
// GH#10329 - we don't need to handle horizontal scrolls. Only vertical ones.
|
||||
// So filter out the horizontal ones.
|
||||
if (point.Properties().IsHorizontalMouseWheel())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto delta = point.Properties().MouseWheelDelta();
|
||||
auto result = _interactivity.MouseWheel(ControlKeyStates{ args.KeyModifiers() },
|
||||
point.Properties().MouseWheelDelta(),
|
||||
point.Properties().IsHorizontalMouseWheel() ?
|
||||
Core::Point{ delta, 0 } :
|
||||
Core::Point{ 0, delta },
|
||||
_toTerminalOrigin(point.Position()),
|
||||
TermControl::GetPressedMouseButtons(point));
|
||||
if (result)
|
||||
@@ -2192,7 +2184,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// - delta: the mouse wheel delta that triggered this event.
|
||||
// - state: the state for each of the mouse buttons individually (pressed/unpressed)
|
||||
bool TermControl::OnMouseWheel(const Windows::Foundation::Point location,
|
||||
const int32_t delta,
|
||||
const Core::Point delta,
|
||||
const bool leftButtonDown,
|
||||
const bool midButtonDown,
|
||||
const bool rightButtonDown)
|
||||
@@ -3791,16 +3783,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
get_self<ControlCore>(_core)->UpdateQuickFixes(suggestions);
|
||||
}
|
||||
|
||||
Core::Scheme TermControl::ColorScheme() const noexcept
|
||||
{
|
||||
return _core.ColorScheme();
|
||||
}
|
||||
|
||||
void TermControl::ColorScheme(const Core::Scheme& scheme) const noexcept
|
||||
{
|
||||
_core.ColorScheme(scheme);
|
||||
}
|
||||
|
||||
void TermControl::AdjustOpacity(const float opacity, const bool relative)
|
||||
{
|
||||
_core.AdjustOpacity(opacity, relative);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "../../tsf/Handle.h"
|
||||
|
||||
#include "ControlInteractivity.h"
|
||||
#include "ControlSettings.h"
|
||||
|
||||
namespace Microsoft::Console::VirtualTerminal
|
||||
{
|
||||
@@ -50,12 +49,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
TermControl(IControlSettings settings, Control::IControlAppearance unfocusedAppearance, TerminalConnection::ITerminalConnection connection);
|
||||
|
||||
static Control::TermControl NewControlByAttachingContent(Control::ControlInteractivity content, const Microsoft::Terminal::Control::IKeyBindings& keyBindings);
|
||||
static Control::TermControl NewControlByAttachingContent(Control::ControlInteractivity content);
|
||||
|
||||
void UpdateControlSettings(Control::IControlSettings settings);
|
||||
void UpdateControlSettings(Control::IControlSettings settings, Control::IControlAppearance unfocusedAppearance);
|
||||
IControlSettings Settings() const;
|
||||
|
||||
void KeyBindings(const Control::IKeyBindings& bindings) { _keyBindings = bindings; }
|
||||
|
||||
uint64_t ContentId() const;
|
||||
|
||||
hstring GetStartingTitle() const;
|
||||
@@ -147,7 +148,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
bool OnDirectKeyEvent(const uint32_t vkey, const uint8_t scanCode, const bool down);
|
||||
|
||||
bool OnMouseWheel(const Windows::Foundation::Point location, const int32_t delta, const bool leftButtonDown, const bool midButtonDown, const bool rightButtonDown);
|
||||
bool OnMouseWheel(const Windows::Foundation::Point location, const winrt::Microsoft::Terminal::Core::Point delta, const bool leftButtonDown, const bool midButtonDown, const bool rightButtonDown);
|
||||
|
||||
~TermControl();
|
||||
|
||||
@@ -176,9 +177,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
Control::CommandHistoryContext CommandHistory() const;
|
||||
void UpdateWinGetSuggestions(Windows::Foundation::Collections::IVector<hstring> suggestions);
|
||||
|
||||
winrt::Microsoft::Terminal::Core::Scheme ColorScheme() const noexcept;
|
||||
void ColorScheme(const winrt::Microsoft::Terminal::Core::Scheme& scheme) const noexcept;
|
||||
|
||||
void AdjustOpacity(const float opacity, const bool relative);
|
||||
|
||||
bool RawWriteKeyEvent(const WORD vkey, const WORD scanCode, const winrt::Microsoft::Terminal::Core::ControlKeyStates modifiers, const bool keyDown);
|
||||
@@ -198,6 +196,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
Control::CursorDisplayState CursorVisibility() const noexcept;
|
||||
void CursorVisibility(Control::CursorDisplayState cursorVisibility);
|
||||
|
||||
void ApplyPreviewColorScheme(const Core::ICoreScheme& scheme) { _core.ApplyPreviewColorScheme(scheme); }
|
||||
void ResetPreviewColorScheme() { _core.ResetPreviewColorScheme(); }
|
||||
void SetOverrideColorScheme(const Core::ICoreScheme& scheme) { _core.SetOverrideColorScheme(scheme); }
|
||||
|
||||
// -------------------------------- WinRT Events ---------------------------------
|
||||
// clang-format off
|
||||
til::property_changed_event PropertyChanged;
|
||||
@@ -249,6 +251,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
Control::TermControlAutomationPeer _automationPeer{ nullptr };
|
||||
Control::ControlInteractivity _interactivity{ nullptr };
|
||||
Control::ControlCore _core{ nullptr };
|
||||
Control::IKeyBindings _keyBindings{ nullptr };
|
||||
TsfDataProvider _tsfDataProvider{ this };
|
||||
winrt::com_ptr<SearchBoxControl> _searchBox;
|
||||
|
||||
@@ -340,7 +343,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return _closing;
|
||||
}
|
||||
|
||||
void _initializeForAttach(const Microsoft::Terminal::Control::IKeyBindings& keyBindings);
|
||||
void _initializeForAttach();
|
||||
|
||||
void _UpdateSettingsFromUIThread();
|
||||
void _UpdateAppearanceFromUIThread(Control::IControlAppearance newAppearance);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "IKeyBindings.idl";
|
||||
import "IMouseWheelListener.idl";
|
||||
import "IControlSettings.idl";
|
||||
import "ControlInteractivity.idl";
|
||||
@@ -36,7 +37,7 @@ namespace Microsoft.Terminal.Control
|
||||
IControlAppearance unfocusedAppearance,
|
||||
Microsoft.Terminal.TerminalConnection.ITerminalConnection connection);
|
||||
|
||||
static TermControl NewControlByAttachingContent(ControlInteractivity content, Microsoft.Terminal.Control.IKeyBindings keyBindings);
|
||||
static TermControl NewControlByAttachingContent(ControlInteractivity content);
|
||||
|
||||
static Windows.Foundation.Size GetProposedDimensions(IControlSettings settings,
|
||||
UInt32 dpi,
|
||||
@@ -46,12 +47,20 @@ namespace Microsoft.Terminal.Control
|
||||
void UpdateControlSettings(IControlSettings settings);
|
||||
void UpdateControlSettings(IControlSettings settings, IControlAppearance unfocusedAppearance);
|
||||
|
||||
void ApplyPreviewColorScheme(Microsoft.Terminal.Core.ICoreScheme scheme);
|
||||
void ResetPreviewColorScheme();
|
||||
|
||||
void SetOverrideColorScheme(Microsoft.Terminal.Core.ICoreScheme scheme);
|
||||
|
||||
Microsoft.Terminal.TerminalConnection.ITerminalConnection Connection;
|
||||
|
||||
UInt64 ContentId{ get; };
|
||||
|
||||
Microsoft.Terminal.Control.IControlSettings Settings { get; };
|
||||
|
||||
// MIDL 3 does not support setter-only properties.
|
||||
void KeyBindings(Microsoft.Terminal.Control.IKeyBindings KeyBindings);
|
||||
|
||||
event Windows.Foundation.TypedEventHandler<Object, TitleChangedEventArgs> TitleChanged;
|
||||
event Windows.Foundation.TypedEventHandler<Object, WriteToClipboardEventArgs> WriteToClipboard;
|
||||
event Windows.Foundation.TypedEventHandler<Object, PasteFromClipboardEventArgs> PasteFromClipboard;
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Microsoft.Terminal.Core
|
||||
{
|
||||
enum MatchMode
|
||||
{
|
||||
None,
|
||||
All
|
||||
};
|
||||
|
||||
enum CursorStyle
|
||||
{
|
||||
Vintage,
|
||||
Bar,
|
||||
Underscore,
|
||||
DoubleUnderscore,
|
||||
FilledBox,
|
||||
EmptyBox
|
||||
};
|
||||
|
||||
enum AdjustTextMode
|
||||
{
|
||||
Never,
|
||||
Indexed,
|
||||
Always,
|
||||
Automatic
|
||||
};
|
||||
|
||||
// TerminalCore declares its own Color struct to avoid depending
|
||||
// on Windows.UI.Color and to avoid passing around unclothed uint32s.
|
||||
// It is supported by til::color for conversions in and out of WinRT land.
|
||||
struct Color
|
||||
{
|
||||
UInt8 R;
|
||||
UInt8 G;
|
||||
UInt8 B;
|
||||
UInt8 A;
|
||||
};
|
||||
|
||||
// Yes, this is also just an IReference<Color>. However, IReference has some
|
||||
// weird ownership semantics that just make it a pain for something as
|
||||
// simple as "maybe this color doesn't have a value set".
|
||||
struct OptionalColor
|
||||
{
|
||||
Boolean HasValue;
|
||||
Microsoft.Terminal.Core.Color Color;
|
||||
};
|
||||
|
||||
// TerminalCore declares its own Color struct to avoid depending on
|
||||
// Windows.UI. Windows.Foundation.Point also exists, but it's composed of
|
||||
// floating-point coordinates, when we almost always need integer coordinates.
|
||||
// It is supported by til::point for conversions in and out of WinRT land.
|
||||
struct Point
|
||||
{
|
||||
Int32 X;
|
||||
Int32 Y;
|
||||
};
|
||||
|
||||
// Same thing here, but with padding. Can't use Windows.UI.Thickness, so
|
||||
// we'll declare our own.
|
||||
struct Padding {
|
||||
Single Left;
|
||||
Single Top;
|
||||
Single Right;
|
||||
Single Bottom;
|
||||
};
|
||||
|
||||
// This is a projection of Microsoft::Terminal::Core::ControlKeyStates,
|
||||
// for conversions in and out of WinRT land.
|
||||
struct ControlKeyStates
|
||||
{
|
||||
UInt32 Value;
|
||||
};
|
||||
|
||||
struct Scheme
|
||||
{
|
||||
Microsoft.Terminal.Core.Color Foreground;
|
||||
Microsoft.Terminal.Core.Color Background;
|
||||
|
||||
Microsoft.Terminal.Core.Color SelectionBackground;
|
||||
|
||||
Microsoft.Terminal.Core.Color CursorColor;
|
||||
|
||||
// Table: A WinRT struct doesn't allow pointers (READ: doesn't allow
|
||||
// array members) in structs, but we very much would like this object to
|
||||
// be a struct. So we'll call out each color individually. There's only
|
||||
// 16, it's not that bad.
|
||||
Microsoft.Terminal.Core.Color Black;
|
||||
Microsoft.Terminal.Core.Color Red;
|
||||
Microsoft.Terminal.Core.Color Green;
|
||||
Microsoft.Terminal.Core.Color Yellow;
|
||||
Microsoft.Terminal.Core.Color Blue;
|
||||
Microsoft.Terminal.Core.Color Purple;
|
||||
Microsoft.Terminal.Core.Color Cyan;
|
||||
Microsoft.Terminal.Core.Color White;
|
||||
Microsoft.Terminal.Core.Color BrightBlack;
|
||||
Microsoft.Terminal.Core.Color BrightRed;
|
||||
Microsoft.Terminal.Core.Color BrightGreen;
|
||||
Microsoft.Terminal.Core.Color BrightYellow;
|
||||
Microsoft.Terminal.Core.Color BrightBlue;
|
||||
Microsoft.Terminal.Core.Color BrightPurple;
|
||||
Microsoft.Terminal.Core.Color BrightCyan;
|
||||
Microsoft.Terminal.Core.Color BrightWhite;
|
||||
};
|
||||
|
||||
declare
|
||||
{
|
||||
// Forward declare this parameterized specialization so that it lives
|
||||
// in TerminalCore instead of being flung to the winds of all IDL dependents.
|
||||
interface Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>;
|
||||
interface Windows.Foundation.IReference<Microsoft.Terminal.Core.Point>;
|
||||
}
|
||||
|
||||
interface ICoreAppearance
|
||||
{
|
||||
Microsoft.Terminal.Core.Color DefaultForeground;
|
||||
Microsoft.Terminal.Core.Color DefaultBackground;
|
||||
Microsoft.Terminal.Core.Color SelectionBackground;
|
||||
Microsoft.Terminal.Core.Color GetColorTableEntry(Int32 index);
|
||||
Microsoft.Terminal.Core.Color CursorColor;
|
||||
CursorStyle CursorShape;
|
||||
UInt32 CursorHeight;
|
||||
Boolean IntenseIsBold;
|
||||
Boolean IntenseIsBright;
|
||||
AdjustTextMode AdjustIndistinguishableColors;
|
||||
|
||||
// NOTE! When adding something here, make sure to update ControlProperties.h too!
|
||||
};
|
||||
}
|
||||
@@ -1,36 +1,136 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "..\ICoreAppearance.idl";
|
||||
|
||||
namespace Microsoft.Terminal.Core
|
||||
{
|
||||
enum MatchMode
|
||||
{
|
||||
None,
|
||||
All
|
||||
};
|
||||
|
||||
enum CursorStyle
|
||||
{
|
||||
Vintage,
|
||||
Bar,
|
||||
Underscore,
|
||||
DoubleUnderscore,
|
||||
FilledBox,
|
||||
EmptyBox
|
||||
};
|
||||
|
||||
enum AdjustTextMode
|
||||
{
|
||||
Never,
|
||||
Indexed,
|
||||
Always,
|
||||
Automatic
|
||||
};
|
||||
|
||||
// TerminalCore declares its own Color struct to avoid depending
|
||||
// on Windows.UI.Color and to avoid passing around unclothed uint32s.
|
||||
// It is supported by til::color for conversions in and out of WinRT land.
|
||||
struct Color
|
||||
{
|
||||
UInt8 R;
|
||||
UInt8 G;
|
||||
UInt8 B;
|
||||
UInt8 A;
|
||||
};
|
||||
|
||||
// Yes, this is also just an IReference<Color>. However, IReference has some
|
||||
// weird ownership semantics that just make it a pain for something as
|
||||
// simple as "maybe this color doesn't have a value set".
|
||||
struct OptionalColor
|
||||
{
|
||||
Boolean HasValue;
|
||||
Microsoft.Terminal.Core.Color Color;
|
||||
};
|
||||
|
||||
// TerminalCore declares its own Color struct to avoid depending on
|
||||
// Windows.UI. Windows.Foundation.Point also exists, but it's composed of
|
||||
// floating-point coordinates, when we almost always need integer coordinates.
|
||||
// It is supported by til::point for conversions in and out of WinRT land.
|
||||
struct Point
|
||||
{
|
||||
Int32 X;
|
||||
Int32 Y;
|
||||
};
|
||||
|
||||
// Same thing here, but with padding. Can't use Windows.UI.Thickness, so
|
||||
// we'll declare our own.
|
||||
struct Padding {
|
||||
Single Left;
|
||||
Single Top;
|
||||
Single Right;
|
||||
Single Bottom;
|
||||
};
|
||||
|
||||
// This is a projection of Microsoft::Terminal::Core::ControlKeyStates,
|
||||
// for conversions in and out of WinRT land.
|
||||
struct ControlKeyStates
|
||||
{
|
||||
UInt32 Value;
|
||||
};
|
||||
|
||||
declare
|
||||
{
|
||||
// Forward declare this parameterized specialization so that it lives
|
||||
// in TerminalCore instead of being flung to the winds of all IDL dependents.
|
||||
interface Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>;
|
||||
interface Windows.Foundation.IReference<Microsoft.Terminal.Core.Point>;
|
||||
}
|
||||
|
||||
interface ICoreScheme
|
||||
{
|
||||
// Table is callee-allocated
|
||||
void GetColorTable(out Microsoft.Terminal.Core.Color[] table);
|
||||
|
||||
Microsoft.Terminal.Core.Color DefaultForeground { get; };
|
||||
Microsoft.Terminal.Core.Color DefaultBackground { get; };
|
||||
Microsoft.Terminal.Core.Color SelectionBackground { get; };
|
||||
Microsoft.Terminal.Core.Color CursorColor { get; };
|
||||
|
||||
// NOTE! When adding something here, make sure to update ControlProperties.h too!
|
||||
};
|
||||
|
||||
interface ICoreAppearance requires ICoreScheme
|
||||
{
|
||||
CursorStyle CursorShape { get; };
|
||||
UInt32 CursorHeight { get; };
|
||||
Boolean IntenseIsBold { get; };
|
||||
Boolean IntenseIsBright { get; };
|
||||
AdjustTextMode AdjustIndistinguishableColors { get; };
|
||||
|
||||
// NOTE! When adding something here, make sure to update ControlProperties.h too!
|
||||
};
|
||||
|
||||
interface ICoreSettings requires ICoreAppearance
|
||||
{
|
||||
// TODO:MSFT:20642297 - define a sentinel for Infinite Scrollback
|
||||
Int32 HistorySize;
|
||||
Int32 InitialRows;
|
||||
Int32 InitialCols;
|
||||
Int32 HistorySize { get; };
|
||||
Int32 InitialRows { get; };
|
||||
Int32 InitialCols { get; };
|
||||
|
||||
Boolean SnapOnInput;
|
||||
Boolean AltGrAliasing;
|
||||
String AnswerbackMessage;
|
||||
Boolean SnapOnInput { get; };
|
||||
Boolean AltGrAliasing { get; };
|
||||
String AnswerbackMessage { get; };
|
||||
|
||||
String StartingTitle;
|
||||
Boolean SuppressApplicationTitle;
|
||||
String WordDelimiters;
|
||||
String StartingTitle { get; };
|
||||
Boolean SuppressApplicationTitle { get; };
|
||||
String WordDelimiters { get; };
|
||||
|
||||
Boolean ForceVTInput;
|
||||
Boolean AllowVtChecksumReport;
|
||||
Boolean AllowVtClipboardWrite;
|
||||
Boolean TrimBlockSelection;
|
||||
Boolean DetectURLs;
|
||||
Boolean ForceVTInput { get; };
|
||||
Boolean AllowVtChecksumReport { get; };
|
||||
Boolean AllowVtClipboardWrite { get; };
|
||||
Boolean TrimBlockSelection { get; };
|
||||
Boolean DetectURLs { get; };
|
||||
|
||||
Windows.Foundation.IReference<Microsoft.Terminal.Core.Color> TabColor;
|
||||
Windows.Foundation.IReference<Microsoft.Terminal.Core.Color> StartingTabColor;
|
||||
Windows.Foundation.IReference<Microsoft.Terminal.Core.Color> TabColor { get; };
|
||||
Windows.Foundation.IReference<Microsoft.Terminal.Core.Color> StartingTabColor { get; };
|
||||
|
||||
Boolean AutoMarkPrompts;
|
||||
Boolean RainbowSuggestions;
|
||||
Boolean AutoMarkPrompts { get; };
|
||||
Boolean RainbowSuggestions { get; };
|
||||
|
||||
// NOTE! When adding something here, make sure to update ControlProperties.h too!
|
||||
};
|
||||
|
||||
@@ -167,20 +167,6 @@ void Terminal::UpdateAppearance(const ICoreAppearance& appearance)
|
||||
break;
|
||||
}
|
||||
|
||||
const til::color newBackgroundColor{ appearance.DefaultBackground() };
|
||||
renderSettings.SetColorAlias(ColorAlias::DefaultBackground, TextColor::DEFAULT_BACKGROUND, newBackgroundColor);
|
||||
const til::color newForegroundColor{ appearance.DefaultForeground() };
|
||||
renderSettings.SetColorAlias(ColorAlias::DefaultForeground, TextColor::DEFAULT_FOREGROUND, newForegroundColor);
|
||||
const til::color newCursorColor{ appearance.CursorColor() };
|
||||
renderSettings.SetColorTableEntry(TextColor::CURSOR_COLOR, newCursorColor);
|
||||
const til::color newSelectionColor{ appearance.SelectionBackground() };
|
||||
renderSettings.SetColorTableEntry(TextColor::SELECTION_BACKGROUND, newSelectionColor);
|
||||
|
||||
for (auto i = 0; i < 16; i++)
|
||||
{
|
||||
renderSettings.SetColorTableEntry(i, til::color{ appearance.GetColorTableEntry(i) });
|
||||
}
|
||||
|
||||
auto cursorShape = CursorType::VerticalBar;
|
||||
switch (appearance.CursorShape())
|
||||
{
|
||||
@@ -215,6 +201,32 @@ void Terminal::UpdateAppearance(const ICoreAppearance& appearance)
|
||||
|
||||
_defaultCursorShape = cursorShape;
|
||||
|
||||
UpdateColorScheme(appearance);
|
||||
}
|
||||
|
||||
void Terminal::UpdateColorScheme(const ICoreScheme& scheme)
|
||||
{
|
||||
auto& renderSettings = GetRenderSettings();
|
||||
|
||||
const til::color newBackgroundColor{ scheme.DefaultBackground() };
|
||||
renderSettings.SetColorAlias(ColorAlias::DefaultBackground, TextColor::DEFAULT_BACKGROUND, newBackgroundColor);
|
||||
const til::color newForegroundColor{ scheme.DefaultForeground() };
|
||||
renderSettings.SetColorAlias(ColorAlias::DefaultForeground, TextColor::DEFAULT_FOREGROUND, newForegroundColor);
|
||||
const til::color newCursorColor{ scheme.CursorColor() };
|
||||
renderSettings.SetColorTableEntry(TextColor::CURSOR_COLOR, newCursorColor);
|
||||
const til::color newSelectionColor{ scheme.SelectionBackground() };
|
||||
renderSettings.SetColorTableEntry(TextColor::SELECTION_BACKGROUND, newSelectionColor);
|
||||
|
||||
winrt::com_array<Color> colors;
|
||||
scheme.GetColorTable(colors);
|
||||
|
||||
assert(colors.size() == 16);
|
||||
|
||||
for (auto i = 0; i < 16; i++)
|
||||
{
|
||||
renderSettings.SetColorTableEntry(i, til::color{ til::at(colors, i) });
|
||||
}
|
||||
|
||||
// Tell the control that the scrollbar has somehow changed. Used as a
|
||||
// workaround to force the control to redraw any scrollbar marks whose color
|
||||
// may have changed.
|
||||
@@ -1298,69 +1310,6 @@ void Terminal::ScrollToSearchHighlight(til::CoordType searchScrollOffset)
|
||||
}
|
||||
}
|
||||
|
||||
Scheme Terminal::GetColorScheme() const
|
||||
{
|
||||
const auto& renderSettings = GetRenderSettings();
|
||||
|
||||
Scheme s;
|
||||
s.Foreground = til::color{ renderSettings.GetColorAlias(ColorAlias::DefaultForeground) };
|
||||
s.Background = til::color{ renderSettings.GetColorAlias(ColorAlias::DefaultBackground) };
|
||||
|
||||
s.CursorColor = til::color{ renderSettings.GetColorTableEntry(TextColor::CURSOR_COLOR) };
|
||||
s.SelectionBackground = til::color{ renderSettings.GetColorTableEntry(TextColor::SELECTION_BACKGROUND) };
|
||||
|
||||
s.Black = til::color{ renderSettings.GetColorTableEntry(TextColor::DARK_BLACK) };
|
||||
s.Red = til::color{ renderSettings.GetColorTableEntry(TextColor::DARK_RED) };
|
||||
s.Green = til::color{ renderSettings.GetColorTableEntry(TextColor::DARK_GREEN) };
|
||||
s.Yellow = til::color{ renderSettings.GetColorTableEntry(TextColor::DARK_YELLOW) };
|
||||
s.Blue = til::color{ renderSettings.GetColorTableEntry(TextColor::DARK_BLUE) };
|
||||
s.Purple = til::color{ renderSettings.GetColorTableEntry(TextColor::DARK_MAGENTA) };
|
||||
s.Cyan = til::color{ renderSettings.GetColorTableEntry(TextColor::DARK_CYAN) };
|
||||
s.White = til::color{ renderSettings.GetColorTableEntry(TextColor::DARK_WHITE) };
|
||||
s.BrightBlack = til::color{ renderSettings.GetColorTableEntry(TextColor::BRIGHT_BLACK) };
|
||||
s.BrightRed = til::color{ renderSettings.GetColorTableEntry(TextColor::BRIGHT_RED) };
|
||||
s.BrightGreen = til::color{ renderSettings.GetColorTableEntry(TextColor::BRIGHT_GREEN) };
|
||||
s.BrightYellow = til::color{ renderSettings.GetColorTableEntry(TextColor::BRIGHT_YELLOW) };
|
||||
s.BrightBlue = til::color{ renderSettings.GetColorTableEntry(TextColor::BRIGHT_BLUE) };
|
||||
s.BrightPurple = til::color{ renderSettings.GetColorTableEntry(TextColor::BRIGHT_MAGENTA) };
|
||||
s.BrightCyan = til::color{ renderSettings.GetColorTableEntry(TextColor::BRIGHT_CYAN) };
|
||||
s.BrightWhite = til::color{ renderSettings.GetColorTableEntry(TextColor::BRIGHT_WHITE) };
|
||||
return s;
|
||||
}
|
||||
|
||||
void Terminal::ApplyScheme(const Scheme& colorScheme)
|
||||
{
|
||||
auto& renderSettings = GetRenderSettings();
|
||||
|
||||
renderSettings.SetColorAlias(ColorAlias::DefaultForeground, TextColor::DEFAULT_FOREGROUND, til::color{ colorScheme.Foreground });
|
||||
renderSettings.SetColorAlias(ColorAlias::DefaultBackground, TextColor::DEFAULT_BACKGROUND, til::color{ colorScheme.Background });
|
||||
|
||||
renderSettings.SetColorTableEntry(TextColor::DARK_BLACK, til::color{ colorScheme.Black });
|
||||
renderSettings.SetColorTableEntry(TextColor::DARK_RED, til::color{ colorScheme.Red });
|
||||
renderSettings.SetColorTableEntry(TextColor::DARK_GREEN, til::color{ colorScheme.Green });
|
||||
renderSettings.SetColorTableEntry(TextColor::DARK_YELLOW, til::color{ colorScheme.Yellow });
|
||||
renderSettings.SetColorTableEntry(TextColor::DARK_BLUE, til::color{ colorScheme.Blue });
|
||||
renderSettings.SetColorTableEntry(TextColor::DARK_MAGENTA, til::color{ colorScheme.Purple });
|
||||
renderSettings.SetColorTableEntry(TextColor::DARK_CYAN, til::color{ colorScheme.Cyan });
|
||||
renderSettings.SetColorTableEntry(TextColor::DARK_WHITE, til::color{ colorScheme.White });
|
||||
renderSettings.SetColorTableEntry(TextColor::BRIGHT_BLACK, til::color{ colorScheme.BrightBlack });
|
||||
renderSettings.SetColorTableEntry(TextColor::BRIGHT_RED, til::color{ colorScheme.BrightRed });
|
||||
renderSettings.SetColorTableEntry(TextColor::BRIGHT_GREEN, til::color{ colorScheme.BrightGreen });
|
||||
renderSettings.SetColorTableEntry(TextColor::BRIGHT_YELLOW, til::color{ colorScheme.BrightYellow });
|
||||
renderSettings.SetColorTableEntry(TextColor::BRIGHT_BLUE, til::color{ colorScheme.BrightBlue });
|
||||
renderSettings.SetColorTableEntry(TextColor::BRIGHT_MAGENTA, til::color{ colorScheme.BrightPurple });
|
||||
renderSettings.SetColorTableEntry(TextColor::BRIGHT_CYAN, til::color{ colorScheme.BrightCyan });
|
||||
renderSettings.SetColorTableEntry(TextColor::BRIGHT_WHITE, til::color{ colorScheme.BrightWhite });
|
||||
|
||||
renderSettings.SetColorTableEntry(TextColor::CURSOR_COLOR, til::color{ colorScheme.CursorColor });
|
||||
renderSettings.SetColorTableEntry(TextColor::SELECTION_BACKGROUND, til::color{ colorScheme.SelectionBackground });
|
||||
|
||||
// Tell the control that the scrollbar has somehow changed. Used as a
|
||||
// workaround to force the control to redraw any scrollbar marks whose color
|
||||
// may have changed.
|
||||
_NotifyScrollEvent();
|
||||
}
|
||||
|
||||
bool Terminal::_inAltBuffer() const noexcept
|
||||
{
|
||||
_assertLocked();
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace winrt::Microsoft::Terminal::Core
|
||||
{
|
||||
struct ICoreSettings;
|
||||
struct ICoreAppearance;
|
||||
struct Scheme;
|
||||
enum class MatchMode;
|
||||
}
|
||||
|
||||
@@ -92,6 +91,7 @@ public:
|
||||
|
||||
void UpdateSettings(winrt::Microsoft::Terminal::Core::ICoreSettings settings);
|
||||
void UpdateAppearance(const winrt::Microsoft::Terminal::Core::ICoreAppearance& appearance);
|
||||
void UpdateColorScheme(const winrt::Microsoft::Terminal::Core::ICoreScheme& scheme);
|
||||
void SetHighContrastMode(bool hc) noexcept;
|
||||
void SetFontInfo(const FontInfo& fontInfo);
|
||||
void SetCursorStyle(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::CursorStyle cursorStyle);
|
||||
@@ -154,7 +154,6 @@ public:
|
||||
void UseMainScreenBuffer() override;
|
||||
|
||||
bool IsVtInputEnabled() const noexcept override;
|
||||
void NotifyAccessibilityChange(const til::rect& changedRect) noexcept override;
|
||||
void NotifyBufferRotation(const int delta) override;
|
||||
void NotifyShellIntegrationMark() override;
|
||||
|
||||
@@ -248,9 +247,6 @@ public:
|
||||
|
||||
const std::optional<til::color> GetTabColor() const;
|
||||
|
||||
winrt::Microsoft::Terminal::Core::Scheme GetColorScheme() const;
|
||||
void ApplyScheme(const winrt::Microsoft::Terminal::Core::Scheme& scheme);
|
||||
|
||||
const size_t GetTaskbarState() const noexcept;
|
||||
const size_t GetTaskbarProgress() const noexcept;
|
||||
|
||||
@@ -373,7 +369,7 @@ private:
|
||||
bool _snapOnInput = true;
|
||||
bool _altGrAliasing = true;
|
||||
bool _suppressApplicationTitle = false;
|
||||
bool _trimBlockSelection = false;
|
||||
bool _trimBlockSelection = true;
|
||||
bool _autoMarkPrompts = false;
|
||||
bool _rainbowSuggestions = false;
|
||||
|
||||
|
||||
@@ -347,11 +347,6 @@ bool Terminal::IsVtInputEnabled() const noexcept
|
||||
return false;
|
||||
}
|
||||
|
||||
void Terminal::NotifyAccessibilityChange(const til::rect& /*changedRect*/) noexcept
|
||||
{
|
||||
// This is only needed in conhost. Terminal handles accessibility in another way.
|
||||
}
|
||||
|
||||
void Terminal::InvokeCompletions(std::wstring_view menuJson, unsigned int replaceLength)
|
||||
{
|
||||
if (_pfnCompletionsChanged)
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Midl Include="..\ICoreSettings.idl" />
|
||||
<Midl Include="..\ICoreAppearance.idl" />
|
||||
</ItemGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
|
||||
@@ -3,20 +3,18 @@
|
||||
|
||||
#include "pch.h"
|
||||
#include "TerminalSettings.h"
|
||||
#include "winrt/Windows.UI.ViewManagement.h"
|
||||
#include "../../types/inc/colorTable.hpp"
|
||||
|
||||
#include "AppearanceConfig.h"
|
||||
|
||||
#include "TerminalSettings.g.cpp"
|
||||
#include "TerminalSettingsCreateResult.g.cpp"
|
||||
|
||||
using namespace winrt::Microsoft::Terminal::Control;
|
||||
using namespace winrt::Microsoft::Terminal::Settings;
|
||||
using namespace Microsoft::Console::Utils;
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
namespace winrt::Microsoft::Terminal::Settings
|
||||
{
|
||||
static std::tuple<Windows::UI::Xaml::HorizontalAlignment, Windows::UI::Xaml::VerticalAlignment> ConvertConvergedAlignment(ConvergedAlignment alignment)
|
||||
static std::tuple<Windows::UI::Xaml::HorizontalAlignment, Windows::UI::Xaml::VerticalAlignment> ConvertConvergedAlignment(Model::ConvergedAlignment alignment)
|
||||
{
|
||||
using Model::ConvergedAlignment;
|
||||
// extract horizontal alignment
|
||||
Windows::UI::Xaml::HorizontalAlignment horizAlign;
|
||||
switch (alignment & static_cast<ConvergedAlignment>(0x0F))
|
||||
@@ -52,7 +50,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
return { horizAlign, vertAlign };
|
||||
}
|
||||
|
||||
winrt::com_ptr<implementation::TerminalSettings> TerminalSettings::_CreateWithProfileCommon(const Model::CascadiaSettings& appSettings, const Model::Profile& profile)
|
||||
winrt::com_ptr<TerminalSettings> TerminalSettings::_CreateWithProfileCommon(const Model::CascadiaSettings& appSettings, const Model::Profile& profile)
|
||||
{
|
||||
auto settings{ winrt::make_self<TerminalSettings>() };
|
||||
|
||||
@@ -64,11 +62,11 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
return settings;
|
||||
}
|
||||
|
||||
Model::TerminalSettings TerminalSettings::CreateForPreview(const Model::CascadiaSettings& appSettings, const Model::Profile& profile)
|
||||
winrt::com_ptr<TerminalSettings> TerminalSettings::CreateForPreview(const Model::CascadiaSettings& appSettings, const Model::Profile& profile)
|
||||
{
|
||||
const auto settings = _CreateWithProfileCommon(appSettings, profile);
|
||||
settings->UseBackgroundImageForWindow(false);
|
||||
return *settings;
|
||||
settings->_UseBackgroundImageForWindow = false;
|
||||
return settings;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -79,25 +77,23 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
// Arguments:
|
||||
// - appSettings: the set of settings being used to construct the new terminal
|
||||
// - profileGuid: the unique identifier (guid) of the profile
|
||||
// - keybindings: the keybinding handler
|
||||
// Return Value:
|
||||
// - A TerminalSettingsCreateResult, which contains a pair of TerminalSettings objects,
|
||||
// one for when the terminal is focused and the other for when the terminal is unfocused
|
||||
Model::TerminalSettingsCreateResult TerminalSettings::CreateWithProfile(const Model::CascadiaSettings& appSettings, const Model::Profile& profile, const IKeyBindings& keybindings)
|
||||
TerminalSettingsCreateResult TerminalSettings::CreateWithProfile(const Model::CascadiaSettings& appSettings, const Model::Profile& profile)
|
||||
{
|
||||
const auto settings = _CreateWithProfileCommon(appSettings, profile);
|
||||
settings->_KeyBindings = keybindings;
|
||||
|
||||
Model::TerminalSettings child{ nullptr };
|
||||
winrt::com_ptr<TerminalSettings> child{ nullptr };
|
||||
if (const auto& unfocusedAppearance{ profile.UnfocusedAppearance() })
|
||||
{
|
||||
const auto globals = appSettings.GlobalSettings();
|
||||
auto childImpl = settings->CreateChild();
|
||||
childImpl->_ApplyAppearanceSettings(unfocusedAppearance, globals.ColorSchemes(), globals.CurrentTheme());
|
||||
child = *childImpl;
|
||||
child = winrt::make_self<TerminalSettings>();
|
||||
child->_parent = settings->get_strong();
|
||||
child->_ApplyAppearanceSettings(unfocusedAppearance, globals.ColorSchemes(), globals.CurrentTheme());
|
||||
}
|
||||
|
||||
return winrt::make<TerminalSettingsCreateResult>(*settings, child);
|
||||
return TerminalSettingsCreateResult{ settings.get(), child.get() };
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -114,23 +110,21 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
// * Additionally, we'll use other values (such as Commandline,
|
||||
// StartingDirectory) in this object to override the settings directly from
|
||||
// the profile.
|
||||
// - keybindings: the keybinding handler
|
||||
// Return Value:
|
||||
// - A TerminalSettingsCreateResult object, which contains a pair of TerminalSettings
|
||||
// objects. One for when the terminal is focused and one for when the terminal is unfocused.
|
||||
Model::TerminalSettingsCreateResult TerminalSettings::CreateWithNewTerminalArgs(const CascadiaSettings& appSettings,
|
||||
const NewTerminalArgs& newTerminalArgs,
|
||||
const IKeyBindings& keybindings)
|
||||
TerminalSettingsCreateResult TerminalSettings::CreateWithNewTerminalArgs(const Model::CascadiaSettings& appSettings,
|
||||
const Model::NewTerminalArgs& newTerminalArgs)
|
||||
{
|
||||
const auto profile = appSettings.GetProfileForArgs(newTerminalArgs);
|
||||
auto settingsPair{ CreateWithProfile(appSettings, profile, keybindings) };
|
||||
auto settingsPair{ CreateWithProfile(appSettings, profile) };
|
||||
auto defaultSettings = settingsPair.DefaultSettings();
|
||||
|
||||
if (newTerminalArgs)
|
||||
{
|
||||
if (const auto id = newTerminalArgs.SessionId(); id != winrt::guid{})
|
||||
{
|
||||
defaultSettings.SessionId(id);
|
||||
defaultSettings->_SessionId = id;
|
||||
}
|
||||
|
||||
// Override commandline, starting directory if they exist in newTerminalArgs
|
||||
@@ -138,20 +132,20 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
{
|
||||
if (!newTerminalArgs.AppendCommandLine())
|
||||
{
|
||||
defaultSettings.Commandline(newTerminalArgs.Commandline());
|
||||
defaultSettings->_Commandline = newTerminalArgs.Commandline();
|
||||
}
|
||||
else
|
||||
{
|
||||
defaultSettings.Commandline(defaultSettings.Commandline() + L" " + newTerminalArgs.Commandline());
|
||||
defaultSettings->_Commandline = defaultSettings->Commandline() + L" " + newTerminalArgs.Commandline();
|
||||
}
|
||||
}
|
||||
if (!newTerminalArgs.StartingDirectory().empty())
|
||||
{
|
||||
defaultSettings.StartingDirectory(newTerminalArgs.StartingDirectory());
|
||||
defaultSettings->_StartingDirectory = newTerminalArgs.StartingDirectory();
|
||||
}
|
||||
if (!newTerminalArgs.TabTitle().empty())
|
||||
{
|
||||
defaultSettings.StartingTitle(newTerminalArgs.TabTitle());
|
||||
defaultSettings->_StartingTitle = newTerminalArgs.TabTitle();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -165,23 +159,23 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
const auto terminator{ commandLine.find_first_of(start ? L'"' : L' ', start) }; // look past the first character if it starts with "
|
||||
// We have to take a copy here; winrt::param::hstring requires a null-terminated string
|
||||
const std::wstring firstComponent{ commandLine.substr(start, terminator - start) };
|
||||
defaultSettings.StartingTitle(firstComponent);
|
||||
defaultSettings->_StartingTitle = winrt::hstring{ firstComponent };
|
||||
}
|
||||
}
|
||||
if (newTerminalArgs.TabColor())
|
||||
{
|
||||
defaultSettings.StartingTabColor(winrt::Windows::Foundation::IReference<winrt::Microsoft::Terminal::Core::Color>{ static_cast<winrt::Microsoft::Terminal::Core::Color>(til::color{ newTerminalArgs.TabColor().Value() }) });
|
||||
defaultSettings->_StartingTabColor = winrt::Windows::Foundation::IReference<winrt::Microsoft::Terminal::Core::Color>{ static_cast<winrt::Microsoft::Terminal::Core::Color>(til::color{ newTerminalArgs.TabColor().Value() }) };
|
||||
}
|
||||
if (newTerminalArgs.SuppressApplicationTitle())
|
||||
{
|
||||
defaultSettings.SuppressApplicationTitle(newTerminalArgs.SuppressApplicationTitle().Value());
|
||||
defaultSettings->_SuppressApplicationTitle = newTerminalArgs.SuppressApplicationTitle().Value();
|
||||
}
|
||||
if (!newTerminalArgs.ColorScheme().empty())
|
||||
{
|
||||
const auto schemes = appSettings.GlobalSettings().ColorSchemes();
|
||||
if (const auto& scheme = schemes.TryLookup(newTerminalArgs.ColorScheme()))
|
||||
{
|
||||
defaultSettings.ApplyColorScheme(scheme);
|
||||
defaultSettings->ApplyColorScheme(scheme);
|
||||
}
|
||||
}
|
||||
// Elevate on NewTerminalArgs is an optional value, so the default
|
||||
@@ -190,20 +184,20 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
// profile will still be launched elevated.
|
||||
if (newTerminalArgs.Elevate())
|
||||
{
|
||||
defaultSettings.Elevate(newTerminalArgs.Elevate().Value());
|
||||
defaultSettings->_Elevate = newTerminalArgs.Elevate().Value();
|
||||
}
|
||||
|
||||
if (newTerminalArgs.ReloadEnvironmentVariables())
|
||||
{
|
||||
defaultSettings.ReloadEnvironmentVariables(newTerminalArgs.ReloadEnvironmentVariables().Value());
|
||||
defaultSettings->_ReloadEnvironmentVariables = newTerminalArgs.ReloadEnvironmentVariables().Value();
|
||||
}
|
||||
}
|
||||
|
||||
return settingsPair;
|
||||
}
|
||||
|
||||
void TerminalSettings::_ApplyAppearanceSettings(const IAppearanceConfig& appearance,
|
||||
const Windows::Foundation::Collections::IMapView<winrt::hstring, ColorScheme>& schemes,
|
||||
void TerminalSettings::_ApplyAppearanceSettings(const Model::IAppearanceConfig& appearance,
|
||||
const Windows::Foundation::Collections::IMapView<winrt::hstring, Model::ColorScheme>& schemes,
|
||||
const winrt::Microsoft::Terminal::Settings::Model::Theme currentTheme)
|
||||
{
|
||||
_CursorShape = appearance.CursorShape();
|
||||
@@ -289,7 +283,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
// - schemes: a map of schemes to look for our color scheme in, if we have one.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
void TerminalSettings::_ApplyProfileSettings(const Profile& profile)
|
||||
void TerminalSettings::_ApplyProfileSettings(const Model::Profile& profile)
|
||||
{
|
||||
// Fill in the Terminal Setting's CoreSettings from the profile
|
||||
_HistorySize = profile.HistorySize();
|
||||
@@ -332,18 +326,18 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
_TabColor = static_cast<winrt::Microsoft::Terminal::Core::Color>(colorRef);
|
||||
}
|
||||
|
||||
const auto profileEnvVars = profile.EnvironmentVariables();
|
||||
if (profileEnvVars == nullptr)
|
||||
if (const auto profileEnvVars{ profile.EnvironmentVariables() })
|
||||
{
|
||||
_EnvironmentVariables = std::nullopt;
|
||||
std::unordered_map<winrt::hstring, winrt::hstring> environmentVariables;
|
||||
for (const auto& [key, value] : profileEnvVars)
|
||||
{
|
||||
environmentVariables.emplace(key, value);
|
||||
}
|
||||
_EnvironmentVariables = winrt::single_threaded_map(std::move(environmentVariables)).GetView();
|
||||
}
|
||||
else
|
||||
{
|
||||
_EnvironmentVariables = winrt::single_threaded_map<winrt::hstring, winrt::hstring>();
|
||||
for (const auto& [key, value] : profileEnvVars)
|
||||
{
|
||||
_EnvironmentVariables.value().Insert(key, value);
|
||||
}
|
||||
_EnvironmentVariables = std::nullopt;
|
||||
}
|
||||
|
||||
_Elevate = profile.Elevate();
|
||||
@@ -401,16 +395,14 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
// settings.
|
||||
if (scheme == nullptr)
|
||||
{
|
||||
ClearAppliedColorScheme();
|
||||
ClearDefaultForeground();
|
||||
ClearDefaultBackground();
|
||||
ClearSelectionBackground();
|
||||
ClearCursorColor();
|
||||
_DefaultForeground = std::nullopt;
|
||||
_DefaultBackground = std::nullopt;
|
||||
_SelectionBackground = std::nullopt;
|
||||
_CursorColor = std::nullopt;
|
||||
_ColorTable = std::nullopt;
|
||||
}
|
||||
else
|
||||
{
|
||||
AppliedColorScheme(scheme);
|
||||
_DefaultForeground = til::color{ scheme.Foreground() };
|
||||
_DefaultBackground = til::color{ scheme.Background() };
|
||||
_SelectionBackground = til::color{ scheme.SelectionBackground() };
|
||||
@@ -421,21 +413,16 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
std::transform(table.cbegin(), table.cend(), colorTable.begin(), [](auto&& color) {
|
||||
return static_cast<winrt::Microsoft::Terminal::Core::Color>(til::color{ color });
|
||||
});
|
||||
ColorTable(colorTable);
|
||||
SetColorTable(colorTable);
|
||||
}
|
||||
}
|
||||
|
||||
winrt::Microsoft::Terminal::Core::Color TerminalSettings::GetColorTableEntry(int32_t index) noexcept
|
||||
{
|
||||
return ColorTable().at(index);
|
||||
}
|
||||
|
||||
void TerminalSettings::ColorTable(std::array<winrt::Microsoft::Terminal::Core::Color, 16> colors)
|
||||
void TerminalSettings::SetColorTable(const std::array<winrt::Microsoft::Terminal::Core::Color, 16>& colors)
|
||||
{
|
||||
_ColorTable = colors;
|
||||
}
|
||||
|
||||
std::array<winrt::Microsoft::Terminal::Core::Color, COLOR_TABLE_SIZE> TerminalSettings::ColorTable()
|
||||
void TerminalSettings::GetColorTable(winrt::com_array<Microsoft::Terminal::Core::Color>& table) noexcept
|
||||
{
|
||||
auto span = _getColorTableImpl();
|
||||
std::array<winrt::Microsoft::Terminal::Core::Color, COLOR_TABLE_SIZE> colorTable{};
|
||||
@@ -449,8 +436,10 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
std::transform(campbellSpan.begin(), campbellSpan.end(), colorTable.begin(), [](auto&& color) {
|
||||
return static_cast<winrt::Microsoft::Terminal::Core::Color>(til::color{ color });
|
||||
});
|
||||
span = colorTable;
|
||||
}
|
||||
return colorTable;
|
||||
|
||||
table = winrt::com_array(span.begin(), span.end());
|
||||
}
|
||||
|
||||
std::span<winrt::Microsoft::Terminal::Core::Color> TerminalSettings::_getColorTableImpl()
|
||||
@@ -459,9 +448,9 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||
{
|
||||
return std::span{ *_ColorTable };
|
||||
}
|
||||
for (auto&& parent : _parents)
|
||||
if (_parent)
|
||||
{
|
||||
auto parentSpan = parent->_getColorTableImpl();
|
||||
auto parentSpan = _parent->_getColorTableImpl();
|
||||
if (parentSpan.size() > 0)
|
||||
{
|
||||
return parentSpan;
|
||||
145
src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.h
Normal file
145
src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/*++
|
||||
Copyright (c) Microsoft Corporation
|
||||
Licensed under the MIT license.
|
||||
|
||||
Module Name:
|
||||
- TerminalSettings.h
|
||||
|
||||
Abstract:
|
||||
- The implementation of the TerminalSettings winrt class. Provides both
|
||||
terminal control settings and terminal core settings.
|
||||
Author(s):
|
||||
- Mike Griese - March 2019
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
#include <../inc/ControlProperties.h>
|
||||
#include <DefaultSettings.h>
|
||||
#include <conattrs.hpp>
|
||||
|
||||
#define SIMPLE_OVERRIDABLE_SETTING(type, name, ...) \
|
||||
private: \
|
||||
std::optional<type> _##name{ std::nullopt }; \
|
||||
\
|
||||
public: \
|
||||
/* Returns the resolved value for this setting */ \
|
||||
type name() const \
|
||||
{ \
|
||||
if (_##name.has_value()) \
|
||||
{ \
|
||||
return *_##name; \
|
||||
} \
|
||||
if (_parent && _parent->_##name.has_value()) \
|
||||
{ \
|
||||
return *_parent->_##name; \
|
||||
} \
|
||||
return type{ __VA_ARGS__ }; \
|
||||
}
|
||||
|
||||
#ifdef UNIT_TESTING
|
||||
namespace SettingsModelUnitTests
|
||||
{
|
||||
class TerminalSettingsTests;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace winrt::Microsoft::Terminal::Settings
|
||||
{
|
||||
using IFontAxesMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, float>;
|
||||
using IFontFeatureMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, float>;
|
||||
using IEnvironmentVariableMapView = winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::hstring>;
|
||||
|
||||
struct TerminalSettingsCreateResult;
|
||||
|
||||
struct TerminalSettings :
|
||||
winrt::implements<TerminalSettings, winrt::Microsoft::Terminal::Core::ICoreSettings, winrt::Microsoft::Terminal::Control::IControlSettings, winrt::Microsoft::Terminal::Core::ICoreAppearance, winrt::Microsoft::Terminal::Core::ICoreScheme, winrt::Microsoft::Terminal::Control::IControlAppearance>
|
||||
{
|
||||
TerminalSettings() = default;
|
||||
|
||||
static winrt::com_ptr<TerminalSettings> CreateForPreview(const Model::CascadiaSettings& appSettings, const Model::Profile& profile);
|
||||
|
||||
static TerminalSettingsCreateResult CreateWithProfile(const Model::CascadiaSettings& appSettings,
|
||||
const Model::Profile& profile);
|
||||
|
||||
static TerminalSettingsCreateResult CreateWithNewTerminalArgs(const Model::CascadiaSettings& appSettings,
|
||||
const Model::NewTerminalArgs& newTerminalArgs);
|
||||
|
||||
void ApplyColorScheme(const Model::ColorScheme& scheme);
|
||||
|
||||
void GetColorTable(winrt::com_array<Microsoft::Terminal::Core::Color>& table) noexcept;
|
||||
void SetColorTable(const std::array<Microsoft::Terminal::Core::Color, 16>& colors);
|
||||
|
||||
// When set, StartingTabColor allows to create a terminal with a "sticky" tab color.
|
||||
// This color is prioritized above the TabColor (that is usually initialized based on profile settings).
|
||||
// Due to this prioritization, the tab color will be preserved upon settings reload
|
||||
// (even if the profile's tab color gets altered or removed).
|
||||
// This property is expected to be passed only once upon terminal creation.
|
||||
// TODO: to ensure that this property is not populated during settings reload,
|
||||
// we should consider moving this property to a separate interface,
|
||||
// passed to the terminal only upon creation.
|
||||
|
||||
CORE_APPEARANCE_SETTINGS(SIMPLE_OVERRIDABLE_SETTING);
|
||||
CONTROL_APPEARANCE_SETTINGS(SIMPLE_OVERRIDABLE_SETTING);
|
||||
CORE_SETTINGS(SIMPLE_OVERRIDABLE_SETTING);
|
||||
CONTROL_SETTINGS(SIMPLE_OVERRIDABLE_SETTING);
|
||||
#if 0
|
||||
SIMPLE_OVERRIDABLE_SETTING(float, Opacity, UseAcrylic() ? 0.5f : 1.0f);
|
||||
SIMPLE_OVERRIDABLE_SETTING(hstring, FontFace, DEFAULT_FONT_FACE);
|
||||
#endif
|
||||
|
||||
// Settings which do not pertain to the control (why are they here?)
|
||||
SIMPLE_OVERRIDABLE_SETTING(bool, Elevate, false);
|
||||
SIMPLE_OVERRIDABLE_SETTING(IEnvironmentVariableMapView, EnvironmentVariables, nullptr);
|
||||
SIMPLE_OVERRIDABLE_SETTING(bool, ReloadEnvironmentVariables, true);
|
||||
|
||||
public:
|
||||
// TerminalApp overrides these when duplicating a session
|
||||
void StartingDirectory(const hstring& startingDirectory) { _StartingDirectory = startingDirectory; }
|
||||
void Commandline(const hstring& commandline) { _Commandline = commandline; }
|
||||
|
||||
private:
|
||||
std::optional<std::array<Microsoft::Terminal::Core::Color, COLOR_TABLE_SIZE>> _ColorTable;
|
||||
std::span<Microsoft::Terminal::Core::Color> _getColorTableImpl();
|
||||
|
||||
static winrt::com_ptr<TerminalSettings> _CreateWithProfileCommon(const Model::CascadiaSettings& appSettings, const Model::Profile& profile);
|
||||
void _ApplyProfileSettings(const Model::Profile& profile);
|
||||
|
||||
void _ApplyGlobalSettings(const Model::GlobalAppSettings& globalSettings) noexcept;
|
||||
void _ApplyAppearanceSettings(const Microsoft::Terminal::Settings::Model::IAppearanceConfig& appearance,
|
||||
const Windows::Foundation::Collections::IMapView<hstring, Microsoft::Terminal::Settings::Model::ColorScheme>& schemes,
|
||||
const winrt::Microsoft::Terminal::Settings::Model::Theme currentTheme);
|
||||
|
||||
winrt::com_ptr<TerminalSettings> _parent;
|
||||
|
||||
#ifdef UNIT_TESTING
|
||||
friend class SettingsModelUnitTests::TerminalSettingsTests;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TerminalSettingsCreateResult
|
||||
{
|
||||
public:
|
||||
TerminalSettingsCreateResult(TerminalSettings* defaultSettings, TerminalSettings* unfocusedSettings)
|
||||
{
|
||||
_defaultSettings.copy_from(defaultSettings);
|
||||
_unfocusedSettings.copy_from(unfocusedSettings);
|
||||
}
|
||||
|
||||
TerminalSettingsCreateResult(TerminalSettings* defaultSettings) :
|
||||
_unfocusedSettings{ nullptr }
|
||||
{
|
||||
_defaultSettings.copy_from(defaultSettings);
|
||||
}
|
||||
|
||||
winrt::com_ptr<TerminalSettings> DefaultSettings() const { return _defaultSettings; };
|
||||
winrt::com_ptr<TerminalSettings> UnfocusedSettings() const { return _unfocusedSettings; };
|
||||
|
||||
private:
|
||||
winrt::com_ptr<TerminalSettings> _defaultSettings;
|
||||
winrt::com_ptr<TerminalSettings> _unfocusedSettings;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#undef SIMPLE_OVERRIDABLE_SETTING
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemDefinitionGroup>
|
||||
<Reference>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{3c46e2b0-ae6c-4132-9122-6772fb411959}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>TerminalSettingsAppAdapterLib</RootNamespace>
|
||||
<ProjectName>TerminalSettingsAppAdapterLib</ProjectName>
|
||||
<TargetName>TerminalSettingsAppAdapterLib</TargetName>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OpenConsoleUniversalApp>true</OpenConsoleUniversalApp>
|
||||
<CppWinRTGenerateWindowsMetadata>false</CppWinRTGenerateWindowsMetadata>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="NuGet Dependencies">
|
||||
<TerminalCppWinrt>true</TerminalCppWinrt>
|
||||
<TerminalMUX>true</TerminalMUX>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
||||
<Import Project="$(OpenConsoleDir)src\common.nugetversions.props" />
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="TerminalSettings.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TerminalSettings.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\types\lib\types.vcxproj" />
|
||||
<Reference Include="Microsoft.Terminal.TerminalConnection">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.Settings.Model">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Settings.Model\Microsoft.Terminal.Settings.Model.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.Control">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)Microsoft.Terminal.Control\Microsoft.Terminal.Control.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Terminal.Core">
|
||||
<HintPath>$(OpenConsoleCommonOutDir)TerminalCore\Microsoft.Terminal.Core.winmd</HintPath>
|
||||
<IsWinMDFile>true</IsWinMDFile>
|
||||
<Private>false</Private>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||
<Import Project="$(OpenConsoleDir)src\common.nugetversions.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Natvis Include="$(SolutionDir)tools\ConsoleTypes.natvis" />
|
||||
<Natvis Include="$(MSBuildThisFileDirectory)..\..\natvis\wil.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp" />
|
||||
<ClCompile Include="TerminalSettings.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="TerminalSettings.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
4
src/cascadia/TerminalSettingsAppAdapterLib/pch.cpp
Normal file
4
src/cascadia/TerminalSettingsAppAdapterLib/pch.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
41
src/cascadia/TerminalSettingsAppAdapterLib/pch.h
Normal file
41
src/cascadia/TerminalSettingsAppAdapterLib/pch.h
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
//
|
||||
// pch.h
|
||||
// Header for platform projection include files
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMCX
|
||||
#define NOHELP
|
||||
#define NOCOMM
|
||||
|
||||
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
||||
#define BLOCK_TIL
|
||||
#include <LibraryIncludes.h>
|
||||
// This is inexplicable, but for whatever reason, cppwinrt conflicts with the
|
||||
// SDK definition of this function, so the only fix is to undef it.
|
||||
// from WinBase.h
|
||||
// Windows::UI::Xaml::Media::Animation::IStoryboard::GetCurrentTime
|
||||
#ifdef GetCurrentTime
|
||||
#undef GetCurrentTime
|
||||
#endif
|
||||
|
||||
#include <wil/cppwinrt.h>
|
||||
|
||||
#include <unknwn.h>
|
||||
|
||||
#include <hstring.h>
|
||||
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Foundation.Collections.h>
|
||||
#include <winrt/Microsoft.Terminal.Settings.Model.h>
|
||||
#include <winrt/Microsoft.Terminal.Core.h>
|
||||
#include <winrt/Microsoft.Terminal.Control.h>
|
||||
|
||||
#include <cppwinrt_utils.h>
|
||||
|
||||
// Manually include til after we include Windows.Foundation to give it winrt superpowers
|
||||
#include "til.h"
|
||||
@@ -492,6 +492,10 @@
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsModel\dll\Microsoft.Terminal.Settings.Model.vcxproj">
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)\src\cascadia\TerminalSettingsAppAdapterLib\TerminalSettingsAppAdapterLib.vcxproj">
|
||||
<Project>{3c46e2b0-ae6c-4132-9122-6772fb411959}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<!-- Manually add a reference to TerminalControl here. We need this so
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <LibraryResources.h>
|
||||
#include "../WinRTUtils/inc/Utils.h"
|
||||
#include "../../renderer/base/FontCache.h"
|
||||
#include "../TerminalSettingsAppAdapterLib/TerminalSettings.h"
|
||||
#include "SegoeFluentIconList.h"
|
||||
#include "../../types/inc/utils.hpp"
|
||||
|
||||
@@ -151,6 +152,22 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
_NotifyChanges(L"AnswerbackMessagePreview");
|
||||
}
|
||||
else if (viewModelProperty == L"TabColor")
|
||||
{
|
||||
_NotifyChanges(L"TabColorPreview");
|
||||
}
|
||||
else if (viewModelProperty == L"TabThemeColorPreview")
|
||||
{
|
||||
_NotifyChanges(L"TabColorPreview");
|
||||
}
|
||||
});
|
||||
|
||||
_defaultAppearanceViewModel.PropertyChanged([this](auto&&, const PropertyChangedEventArgs& args) {
|
||||
const auto viewModelProperty{ args.PropertyName() };
|
||||
if (viewModelProperty == L"DarkColorSchemeName" || viewModelProperty == L"LightColorSchemeName")
|
||||
{
|
||||
_NotifyChanges(L"TabThemeColorPreview");
|
||||
}
|
||||
});
|
||||
|
||||
// Do the same for the starting directory
|
||||
@@ -284,12 +301,12 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
return _parsedPadding.Bottom;
|
||||
}
|
||||
Model::TerminalSettings ProfileViewModel::TermSettings() const
|
||||
Control::IControlSettings ProfileViewModel::TermSettings() const
|
||||
{
|
||||
// This may look pricey, but it only resolves resources that have not been visited
|
||||
// and the preview update is debounced.
|
||||
_appSettings.ResolveMediaResources();
|
||||
return Model::TerminalSettings::CreateForPreview(_appSettings, _profile);
|
||||
return *Settings::TerminalSettings::CreateForPreview(_appSettings, _profile);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -437,7 +454,85 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
return RS_(L"Profile_AnswerbackMessageNone");
|
||||
}
|
||||
|
||||
Editor::AppearanceViewModel ProfileViewModel::DefaultAppearance()
|
||||
Windows::UI::Color ProfileViewModel::TabColorPreview() const
|
||||
{
|
||||
if (const auto modelVal = _profile.TabColor())
|
||||
{
|
||||
const auto color = modelVal.Value();
|
||||
// user defined an override value
|
||||
return Windows::UI::Color{
|
||||
.A = 255,
|
||||
.R = color.R,
|
||||
.G = color.G,
|
||||
.B = color.B
|
||||
};
|
||||
}
|
||||
// set to null --> deduce value from theme
|
||||
return TabThemeColorPreview();
|
||||
}
|
||||
|
||||
Windows::UI::Color ProfileViewModel::TabThemeColorPreview() const
|
||||
{
|
||||
const auto currentTheme = _appSettings.GlobalSettings().CurrentTheme();
|
||||
if (const auto tabTheme = currentTheme.Tab())
|
||||
{
|
||||
// theme.tab.background: theme color must be evaluated
|
||||
if (const auto tabBackground = tabTheme.Background())
|
||||
{
|
||||
const auto& tabBrush = tabBackground.Evaluate(Application::Current().Resources(),
|
||||
Windows::UI::Xaml::Media::SolidColorBrush{ DefaultAppearance().CurrentColorScheme().BackgroundColor().Color() },
|
||||
false);
|
||||
if (const auto& tabColorBrush = tabBrush.try_as<Windows::UI::Xaml::Media::SolidColorBrush>())
|
||||
{
|
||||
const auto brushColor = tabColorBrush.Color();
|
||||
return brushColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (const auto windowTheme = currentTheme.Window())
|
||||
{
|
||||
// theme.window.applicationTheme: evaluate light/dark to XAML default tab color
|
||||
// Can also be "Default", in which case we fall through below
|
||||
const auto appTheme = windowTheme.RequestedTheme();
|
||||
if (appTheme == ElementTheme::Dark)
|
||||
{
|
||||
return Windows::UI::Color{
|
||||
.A = 0xFF,
|
||||
.R = 0x28,
|
||||
.G = 0x28,
|
||||
.B = 0x28
|
||||
};
|
||||
}
|
||||
else if (appTheme == ElementTheme::Light)
|
||||
{
|
||||
return Windows::UI::Color{
|
||||
.A = 0xFF,
|
||||
.R = 0xF9,
|
||||
.G = 0xF9,
|
||||
.B = 0xF9
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// XAML default tab color
|
||||
if (Model::Theme::IsSystemInDarkTheme())
|
||||
{
|
||||
return Windows::UI::Color{
|
||||
.A = 0xFF,
|
||||
.R = 0x28,
|
||||
.G = 0x28,
|
||||
.B = 0x28
|
||||
};
|
||||
}
|
||||
return Windows::UI::Color{
|
||||
.A = 0xFF,
|
||||
.R = 0xF9,
|
||||
.G = 0xF9,
|
||||
.B = 0xF9
|
||||
};
|
||||
}
|
||||
|
||||
Editor::AppearanceViewModel ProfileViewModel::DefaultAppearance() const
|
||||
{
|
||||
return _defaultAppearanceViewModel;
|
||||
}
|
||||
@@ -476,7 +571,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
_NotifyChanges(L"UnfocusedAppearance", L"HasUnfocusedAppearance", L"ShowUnfocusedAppearance");
|
||||
}
|
||||
|
||||
Editor::AppearanceViewModel ProfileViewModel::UnfocusedAppearance()
|
||||
Editor::AppearanceViewModel ProfileViewModel::UnfocusedAppearance() const
|
||||
{
|
||||
return _unfocusedAppearanceViewModel;
|
||||
}
|
||||
@@ -720,7 +815,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
}
|
||||
}
|
||||
_MarkDuplicateBellSoundDirectories();
|
||||
_CheckBellSoundsExistence();
|
||||
_NotifyChanges(L"CurrentBellSounds");
|
||||
}
|
||||
|
||||
@@ -732,19 +826,14 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
if (!_profile.HasBellSound())
|
||||
{
|
||||
std::vector<hstring> newSounds;
|
||||
std::vector<IMediaResource> newSounds;
|
||||
if (const auto inheritedSounds = _profile.BellSound())
|
||||
{
|
||||
// copy inherited bell sounds to the current layer
|
||||
newSounds.reserve(inheritedSounds.Size());
|
||||
for (const auto sound : inheritedSounds)
|
||||
{
|
||||
newSounds.push_back(sound);
|
||||
}
|
||||
newSounds = wil::to_vector(inheritedSounds);
|
||||
}
|
||||
// if we didn't inherit any bell sounds,
|
||||
// we should still set the bell sound to an empty list (instead of null)
|
||||
_profile.BellSound(winrt::single_threaded_vector<hstring>(std::move(newSounds)));
|
||||
_profile.BellSound(winrt::single_threaded_vector(std::move(newSounds)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,56 +857,35 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Check if the bell sounds exist on disk. Mark any that don't exist
|
||||
// so that they show the appropriate UI
|
||||
safe_void_coroutine ProfileViewModel::_CheckBellSoundsExistence()
|
||||
BellSoundViewModel::BellSoundViewModel(const Model::IMediaResource& resource) :
|
||||
_resource{ resource }
|
||||
{
|
||||
co_await winrt::resume_background();
|
||||
std::vector<Editor::BellSoundViewModel> markedSounds;
|
||||
for (auto&& sound : _CurrentBellSounds)
|
||||
if (_resource.Ok() && _resource.Path() != _resource.Resolved())
|
||||
{
|
||||
if (!std::filesystem::exists(std::wstring_view{ sound.Path() }))
|
||||
{
|
||||
markedSounds.push_back(sound);
|
||||
}
|
||||
// If the resource was resolved to something other than its path, show the path!
|
||||
_ShowDirectory = true;
|
||||
}
|
||||
|
||||
co_await winrt::resume_foreground(_dispatcher);
|
||||
for (auto&& sound : markedSounds)
|
||||
{
|
||||
get_self<BellSoundViewModel>(sound)->FileExists(false);
|
||||
}
|
||||
}
|
||||
|
||||
BellSoundViewModel::BellSoundViewModel(hstring path) :
|
||||
_Path{ path }
|
||||
{
|
||||
PropertyChanged([this](auto&&, const PropertyChangedEventArgs& args) {
|
||||
if (args.PropertyName() == L"FileExists")
|
||||
{
|
||||
_NotifyChanges(L"DisplayPath", L"SubText");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
hstring BellSoundViewModel::DisplayPath() const
|
||||
{
|
||||
if (_FileExists)
|
||||
if (_resource.Ok())
|
||||
{
|
||||
// filename
|
||||
const std::filesystem::path filePath{ std::wstring_view{ _Path } };
|
||||
// filename; start from the resolved path to show where it actually landed
|
||||
auto resolvedPath{ _resource.Resolved() };
|
||||
const std::filesystem::path filePath{ std::wstring_view{ resolvedPath } };
|
||||
return hstring{ filePath.filename().wstring() };
|
||||
}
|
||||
return _Path;
|
||||
return _resource.Path();
|
||||
}
|
||||
|
||||
hstring BellSoundViewModel::SubText() const
|
||||
{
|
||||
if (_FileExists)
|
||||
if (_resource.Ok())
|
||||
{
|
||||
// Directory
|
||||
const std::filesystem::path filePath{ std::wstring_view{ _Path } };
|
||||
auto resolvedPath{ _resource.Resolved() };
|
||||
const std::filesystem::path filePath{ std::wstring_view{ resolvedPath } };
|
||||
return hstring{ filePath.parent_path().wstring() };
|
||||
}
|
||||
return RS_(L"Profile_BellSoundNotFound");
|
||||
@@ -825,17 +893,22 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
|
||||
hstring ProfileViewModel::BellSoundPreview()
|
||||
{
|
||||
const auto& currentSound = BellSound();
|
||||
if (!currentSound || currentSound.Size() == 0)
|
||||
if (!_CurrentBellSounds || _CurrentBellSounds.Size() == 0)
|
||||
{
|
||||
return RS_(L"Profile_BellSoundPreviewDefault");
|
||||
}
|
||||
else if (currentSound.Size() == 1)
|
||||
if (_CurrentBellSounds.Size() > 1)
|
||||
{
|
||||
std::filesystem::path filePath{ std::wstring_view{ currentSound.GetAt(0) } };
|
||||
return hstring{ filePath.filename().wstring() };
|
||||
return RS_(L"Profile_BellSoundPreviewMultiple");
|
||||
}
|
||||
return RS_(L"Profile_BellSoundPreviewMultiple");
|
||||
|
||||
const auto currentBellSound = _CurrentBellSounds.GetAt(0);
|
||||
if (currentBellSound.FileExists())
|
||||
{
|
||||
return currentBellSound.DisplayPath();
|
||||
}
|
||||
|
||||
return RS_(L"Profile_BellSoundNotFound");
|
||||
}
|
||||
|
||||
void ProfileViewModel::RequestAddBellSound(hstring path)
|
||||
@@ -844,9 +917,10 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
// copy it over to the current layer and apply modifications
|
||||
_PrepareModelForBellSoundModification();
|
||||
|
||||
// No need to check if the file exists. We came from the FilePicker. That's good enough.
|
||||
_CurrentBellSounds.Append(winrt::make<BellSoundViewModel>(path));
|
||||
_profile.BellSound().Append(path);
|
||||
auto bellResource{ MediaResourceHelper::FromString(path) };
|
||||
bellResource.Resolve(path); // No need to check if the file exists. We came from the FilePicker. That's good enough.
|
||||
_CurrentBellSounds.Append(winrt::make<BellSoundViewModel>(bellResource));
|
||||
_profile.BellSound().Append(bellResource);
|
||||
_NotifyChanges(L"CurrentBellSounds");
|
||||
}
|
||||
|
||||
|
||||
@@ -30,13 +30,16 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
struct BellSoundViewModel : BellSoundViewModelT<BellSoundViewModel>, ViewModelHelper<BellSoundViewModel>
|
||||
{
|
||||
public:
|
||||
BellSoundViewModel(hstring path);
|
||||
BellSoundViewModel(const Model::IMediaResource& resource);
|
||||
|
||||
hstring Path() const { return _resource.Path(); }
|
||||
bool FileExists() const { return _resource.Ok(); }
|
||||
hstring DisplayPath() const;
|
||||
hstring SubText() const;
|
||||
VIEW_MODEL_OBSERVABLE_PROPERTY(bool, FileExists, true);
|
||||
VIEW_MODEL_OBSERVABLE_PROPERTY(hstring, Path);
|
||||
VIEW_MODEL_OBSERVABLE_PROPERTY(bool, ShowDirectory);
|
||||
|
||||
private:
|
||||
Model::IMediaResource _resource;
|
||||
};
|
||||
|
||||
struct ProfileViewModel : ProfileViewModelT<ProfileViewModel>, ViewModelHelper<ProfileViewModel>
|
||||
@@ -49,7 +52,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
static Windows::Foundation::Collections::IVector<IInspectable> BuiltInIcons() noexcept { return _BuiltInIcons; };
|
||||
|
||||
ProfileViewModel(const Model::Profile& profile, const Model::CascadiaSettings& settings, const Windows::UI::Core::CoreDispatcher& dispatcher);
|
||||
Model::TerminalSettings TermSettings() const;
|
||||
Control::IControlSettings TermSettings() const;
|
||||
void DeleteProfile();
|
||||
|
||||
void SetupAppearances(Windows::Foundation::Collections::IObservableVector<Editor::ColorSchemeViewModel> schemesList);
|
||||
@@ -109,8 +112,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
// general profile knowledge
|
||||
winrt::guid OriginalProfileGuid() const noexcept;
|
||||
bool CanDeleteProfile() const;
|
||||
Editor::AppearanceViewModel DefaultAppearance();
|
||||
Editor::AppearanceViewModel UnfocusedAppearance();
|
||||
Editor::AppearanceViewModel DefaultAppearance() const;
|
||||
Editor::AppearanceViewModel UnfocusedAppearance() const;
|
||||
bool HasUnfocusedAppearance();
|
||||
bool EditableUnfocusedAppearance() const noexcept;
|
||||
bool ShowUnfocusedAppearance();
|
||||
@@ -124,6 +127,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
bool Orphaned() const;
|
||||
hstring TabTitlePreview() const;
|
||||
hstring AnswerbackMessagePreview() const;
|
||||
Windows::UI::Color TabColorPreview() const;
|
||||
Windows::UI::Color TabThemeColorPreview() const;
|
||||
|
||||
til::typed_event<Editor::ProfileViewModel, Editor::DeleteProfileEventArgs> DeleteProfileRequested;
|
||||
|
||||
@@ -190,7 +195,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
void _InitializeCurrentBellSounds();
|
||||
void _PrepareModelForBellSoundModification();
|
||||
void _MarkDuplicateBellSoundDirectories();
|
||||
safe_void_coroutine _CheckBellSoundsExistence();
|
||||
static Windows::Foundation::Collections::IObservableVector<Editor::Font> _MonospaceFontList;
|
||||
static Windows::Foundation::Collections::IObservableVector<Editor::Font> _FontList;
|
||||
static Windows::Foundation::Collections::IVector<Windows::Foundation::IInspectable> _BuiltInIcons;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
|
||||
runtimeclass BellSoundViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
String Path;
|
||||
String Path { get; };
|
||||
String DisplayPath { get; };
|
||||
String SubText { get; };
|
||||
Boolean ShowDirectory { get; };
|
||||
@@ -52,8 +52,6 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
|
||||
runtimeclass ProfileViewModel : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
{
|
||||
Microsoft.Terminal.Settings.Model.TerminalSettings TermSettings { get; };
|
||||
|
||||
event Windows.Foundation.TypedEventHandler<ProfileViewModel, DeleteProfileEventArgs> DeleteProfileRequested;
|
||||
|
||||
void SetupAppearances(Windows.Foundation.Collections.IObservableVector<ColorSchemeViewModel> schemesList);
|
||||
@@ -123,6 +121,8 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
|
||||
String TabTitlePreview { get; };
|
||||
String AnswerbackMessagePreview { get; };
|
||||
Windows.UI.Color TabColorPreview { get; };
|
||||
Windows.UI.Color TabThemeColorPreview { get; };
|
||||
|
||||
void CreateUnfocusedAppearance();
|
||||
void DeleteUnfocusedAppearance();
|
||||
@@ -149,7 +149,7 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SnapOnInput);
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, AltGrAliasing);
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Settings.Model.BellStyle, BellStyle);
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.Collections.IVector<String>, BellSound);
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.Collections.IVector<Microsoft.Terminal.Settings.Model.IMediaResource>, BellSound);
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, Elevate);
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, ReloadEnvironmentVariables);
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, RightClickContextMenu);
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
|
||||
if (!_previewControl)
|
||||
{
|
||||
const auto settings = _Profile.TermSettings();
|
||||
const auto settings = winrt::get_self<implementation::ProfileViewModel>(_Profile)->TermSettings();
|
||||
_previewConnection->DisplayPowerlineGlyphs(_Profile.DefaultAppearance().HasPowerlineCharacters());
|
||||
_previewControl = Control::TermControl(settings, settings, *_previewConnection);
|
||||
_previewControl.IsEnabled(false);
|
||||
@@ -97,7 +97,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
.trailing = true,
|
||||
},
|
||||
[this]() {
|
||||
const auto settings = _Profile.TermSettings();
|
||||
const auto settings = winrt::get_self<implementation::ProfileViewModel>(_Profile)->TermSettings();
|
||||
_previewConnection->DisplayPowerlineGlyphs(_Profile.DefaultAppearance().HasPowerlineCharacters());
|
||||
_previewControl.UpdateControlSettings(settings, settings);
|
||||
});
|
||||
|
||||
@@ -208,6 +208,22 @@
|
||||
Text="{x:Bind Profile.TabTitle, Mode=TwoWay}" />
|
||||
</local:SettingContainer>
|
||||
|
||||
<!-- Tab Color -->
|
||||
<local:SettingContainer x:Name="TabColor"
|
||||
x:Uid="Profile_TabColor"
|
||||
ClearSettingValue="{x:Bind Profile.ClearTabColor}"
|
||||
CurrentValue="{x:Bind Profile.TabColorPreview, Mode=OneWay}"
|
||||
CurrentValueAccessibleName="{x:Bind Profile.TabColorPreview, Converter={StaticResource ColorToStringConverter}, Mode=OneWay}"
|
||||
CurrentValueTemplate="{StaticResource ColorPreviewTemplate}"
|
||||
HasSettingValue="{x:Bind Profile.HasTabColor, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind Profile.TabColorOverrideSource, Mode=OneWay}"
|
||||
Style="{StaticResource ExpanderSettingContainerStyleWithComplexPreview}">
|
||||
<local:NullableColorPicker x:Uid="Profile_TabColor_NullableColorPicker"
|
||||
ColorSchemeVM="{x:Bind Profile.DefaultAppearance.CurrentColorScheme, Mode=OneWay}"
|
||||
CurrentColor="{x:Bind Profile.TabColor, Mode=TwoWay}"
|
||||
NullColorPreview="{x:Bind Profile.TabThemeColorPreview, Mode=OneWay}" />
|
||||
</local:SettingContainer>
|
||||
|
||||
<!-- Elevate -->
|
||||
<local:SettingContainer x:Uid="Profile_Elevate"
|
||||
ClearSettingValue="{x:Bind Profile.ClearElevate}"
|
||||
|
||||
@@ -2076,6 +2076,10 @@
|
||||
<value>Schemafarbe verwenden</value>
|
||||
<comment>Label for a button directing the user to use the selection background color defined in the terminal's current color scheme.</comment>
|
||||
</data>
|
||||
<data name="Profile_TabColor_NullableColorPicker.NullColorButtonLabel" xml:space="preserve">
|
||||
<value>Designfarbe verwenden</value>
|
||||
<comment>Label for a button directing the user to use the tab color defined in the terminal's current theme.</comment>
|
||||
</data>
|
||||
<data name="Profile_IconTypeNone" xml:space="preserve">
|
||||
<value>Keine</value>
|
||||
<comment>An option to choose from for the "icon style" dropdown. When selected, there will be no icon for the profile.</comment>
|
||||
|
||||
@@ -2080,6 +2080,10 @@
|
||||
<value>Use scheme color</value>
|
||||
<comment>Label for a button directing the user to use the selection background color defined in the terminal's current color scheme.</comment>
|
||||
</data>
|
||||
<data name="Profile_TabColor_NullableColorPicker.NullColorButtonLabel" xml:space="preserve">
|
||||
<value>Use theme color</value>
|
||||
<comment>Label for a button directing the user to use the tab color defined in the terminal's current theme.</comment>
|
||||
</data>
|
||||
<data name="Profile_IconTypeNone" xml:space="preserve">
|
||||
<value>None</value>
|
||||
<comment>An option to choose from for the "icon style" dropdown. When selected, there will be no icon for the profile.</comment>
|
||||
|
||||
@@ -2076,6 +2076,10 @@
|
||||
<value>Usar color de la combinación</value>
|
||||
<comment>Label for a button directing the user to use the selection background color defined in the terminal's current color scheme.</comment>
|
||||
</data>
|
||||
<data name="Profile_TabColor_NullableColorPicker.NullColorButtonLabel" xml:space="preserve">
|
||||
<value>Usar color de tema</value>
|
||||
<comment>Label for a button directing the user to use the tab color defined in the terminal's current theme.</comment>
|
||||
</data>
|
||||
<data name="Profile_IconTypeNone" xml:space="preserve">
|
||||
<value>Ninguno</value>
|
||||
<comment>An option to choose from for the "icon style" dropdown. When selected, there will be no icon for the profile.</comment>
|
||||
|
||||
@@ -2076,6 +2076,10 @@
|
||||
<value>Utiliser la couleur du jeu</value>
|
||||
<comment>Label for a button directing the user to use the selection background color defined in the terminal's current color scheme.</comment>
|
||||
</data>
|
||||
<data name="Profile_TabColor_NullableColorPicker.NullColorButtonLabel" xml:space="preserve">
|
||||
<value>Utiliser la couleur de thème</value>
|
||||
<comment>Label for a button directing the user to use the tab color defined in the terminal's current theme.</comment>
|
||||
</data>
|
||||
<data name="Profile_IconTypeNone" xml:space="preserve">
|
||||
<value>Aucun</value>
|
||||
<comment>An option to choose from for the "icon style" dropdown. When selected, there will be no icon for the profile.</comment>
|
||||
|
||||
@@ -2076,6 +2076,10 @@
|
||||
<value>Usa colore combinazione</value>
|
||||
<comment>Label for a button directing the user to use the selection background color defined in the terminal's current color scheme.</comment>
|
||||
</data>
|
||||
<data name="Profile_TabColor_NullableColorPicker.NullColorButtonLabel" xml:space="preserve">
|
||||
<value>Usa colore del tema</value>
|
||||
<comment>Label for a button directing the user to use the tab color defined in the terminal's current theme.</comment>
|
||||
</data>
|
||||
<data name="Profile_IconTypeNone" xml:space="preserve">
|
||||
<value>Nessuno</value>
|
||||
<comment>An option to choose from for the "icon style" dropdown. When selected, there will be no icon for the profile.</comment>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user