mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-11 08:41:06 +00:00
Compare commits
43 Commits
release-1.
...
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 |
1
.github/actions/spelling/allow/apis.txt
vendored
1
.github/actions/spelling/allow/apis.txt
vendored
@@ -178,7 +178,6 @@ ubrk
|
||||
UChar
|
||||
UFIELD
|
||||
ULARGE
|
||||
UNCEx
|
||||
UOI
|
||||
UPDATEINIFILE
|
||||
urlmon
|
||||
|
||||
16
.github/actions/spelling/expect/expect.txt
vendored
16
.github/actions/spelling/expect/expect.txt
vendored
@@ -141,7 +141,6 @@ BValue
|
||||
Cacafire
|
||||
CALLCONV
|
||||
CANDRABINDU
|
||||
CANTCALLOUT
|
||||
capslock
|
||||
CARETBLINKINGENABLED
|
||||
CARRIAGERETURN
|
||||
@@ -808,9 +807,9 @@ IMPEXP
|
||||
inbox
|
||||
inclusivity
|
||||
INCONTEXT
|
||||
INDEXID
|
||||
INFOEX
|
||||
inheritcursor
|
||||
ININPUTSYNCCALL
|
||||
INITCOMMONCONTROLSEX
|
||||
INITDIALOG
|
||||
INITGUID
|
||||
@@ -910,6 +909,7 @@ LNM
|
||||
LOADONCALL
|
||||
LOBYTE
|
||||
localappdata
|
||||
LOCATIONCHANGE
|
||||
locsrc
|
||||
Loewen
|
||||
LOGBRUSH
|
||||
@@ -1035,6 +1035,7 @@ MOUSEACTIVATE
|
||||
MOUSEFIRST
|
||||
MOUSEHWHEEL
|
||||
MOVESTART
|
||||
msaa
|
||||
msb
|
||||
msbuildcache
|
||||
msctls
|
||||
@@ -1063,7 +1064,6 @@ Mypair
|
||||
Myval
|
||||
NAMELENGTH
|
||||
namestream
|
||||
NCACTIVATE
|
||||
NCCALCSIZE
|
||||
NCCREATE
|
||||
NCLBUTTONDOWN
|
||||
@@ -1094,8 +1094,6 @@ NEXTLINE
|
||||
nfe
|
||||
NLSMODE
|
||||
NOACTIVATE
|
||||
NOACTIVATEKEYBOARDLAYOUT
|
||||
NOACTIVATETIP
|
||||
NOAPPLYNOW
|
||||
NOCLIP
|
||||
NOCOMM
|
||||
@@ -1510,6 +1508,7 @@ scrolllock
|
||||
scrolloffset
|
||||
SCROLLSCALE
|
||||
SCROLLSCREENBUFFER
|
||||
scursor
|
||||
sddl
|
||||
SDKDDK
|
||||
segfault
|
||||
@@ -1589,6 +1588,7 @@ SLGP
|
||||
SLIST
|
||||
slmult
|
||||
sln
|
||||
slnx
|
||||
slpit
|
||||
SManifest
|
||||
SMARTQUOTE
|
||||
@@ -1707,11 +1707,9 @@ TEXTMETRIC
|
||||
TEXTMETRICW
|
||||
textmode
|
||||
texttests
|
||||
TFCAT
|
||||
THUMBPOSITION
|
||||
THUMBTRACK
|
||||
tilunittests
|
||||
TIPCAP
|
||||
titlebars
|
||||
TITLEISLINKNAME
|
||||
TLDP
|
||||
@@ -1763,8 +1761,6 @@ UIACCESS
|
||||
uiacore
|
||||
uiautomationcore
|
||||
uielem
|
||||
UIELEMENTENABLED
|
||||
UIELEMENTENABLEDONLY
|
||||
UINTs
|
||||
uld
|
||||
uldash
|
||||
@@ -1980,8 +1976,8 @@ WRITECONSOLEINPUT
|
||||
WRITECONSOLEOUTPUT
|
||||
WRITECONSOLEOUTPUTSTRING
|
||||
wrkstr
|
||||
WRL
|
||||
wrl
|
||||
WRL
|
||||
wrp
|
||||
WRunoff
|
||||
WSLENV
|
||||
|
||||
2309
OpenConsole.sln
2309
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 -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"PackageContents/WindowsTerminalShellExt.dll",
|
||||
|
||||
// The rest
|
||||
"PackageContents/TerminalAzBridge.exe",
|
||||
"PackageContents/wt.exe",
|
||||
"PackageContents/WindowsTerminal.exe",
|
||||
"PackageContents/elevate-shim.exe"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Optional, defaults to main. Name of the branch which will be used for calculating branch point. -->
|
||||
<PGOBranch>release-1.24</PGOBranch>
|
||||
<PGOBranch>main</PGOBranch>
|
||||
|
||||
<!-- Mandatory. Name of the NuGet package which will contain PGO databases for consumption by build system. -->
|
||||
<PGOPackageName>Microsoft.Internal.Windows.Terminal.PGODatabase</PGOPackageName>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -50,7 +50,6 @@ stages:
|
||||
buildEverything: true
|
||||
pgoBuildMode: Instrument
|
||||
artifactStem: -instrumentation
|
||||
keepAllExpensiveBuildOutputs: false # the ARM64 build agent runs out of memory downloading the artifacts...
|
||||
|
||||
- stage: RunPGO
|
||||
displayName: Run PGO
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -26,7 +26,6 @@ jobs:
|
||||
pgoToolsPath: $(Build.SourcesDirectory)\build\PGO
|
||||
nuspecPath: $(pgoToolsPath)\NuSpecs
|
||||
nuspecFilename: PGO.nuspec
|
||||
nugetFeed: "https://pkgs.dev.azure.com/shine-oss/terminal/_packaging/TerminalDependencies/nuget/v3/index.json"
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
@@ -46,8 +45,7 @@ jobs:
|
||||
|
||||
- task: NuGetAuthenticate@1
|
||||
inputs:
|
||||
azureDevOpsServiceConnection: 'Terminal Public Artifact Feed'
|
||||
feedUrl: $(nugetFeed)
|
||||
nuGetServiceConnections: 'Terminal Public Artifact Feed'
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
@@ -70,7 +68,15 @@ jobs:
|
||||
artifact: pgo-nupkg-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
|
||||
displayName: "Publish Pipeline Artifact"
|
||||
|
||||
- pwsh: |-
|
||||
$nupkg = Get-Item "$(Build.ArtifactStagingDirectory)/*.nupkg"
|
||||
& nuget push -ApiKey az -Source "$(nugetFeed)" "$nupkg"
|
||||
displayName: NuGet push
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: 'NuGet push'
|
||||
inputs:
|
||||
command: push
|
||||
nuGetFeedType: external
|
||||
packagesToPush: $(Build.ArtifactStagingDirectory)/*.nupkg
|
||||
# The actual URL and PAT for this feed is configured at
|
||||
# https://microsoft.visualstudio.com/Dart/_settings/adminservices
|
||||
# This is the name of that connection
|
||||
publishFeedCredentials: 'Terminal Public Artifact Feed'
|
||||
feedsToUse: config
|
||||
nugetConfigPath: '$(Build.SourcesDirectory)/NuGet.config'
|
||||
|
||||
@@ -45,10 +45,6 @@ jobs:
|
||||
displayName: Extract the unpackaged build for PGO
|
||||
|
||||
- template: steps-ensure-nuget-version.yml
|
||||
parameters:
|
||||
${{ if eq(parameters.buildPlatform, 'arm64') }}:
|
||||
# The ARM64 agents do not seem to have NuGet installed
|
||||
forceNugetInstallation: true
|
||||
|
||||
- powershell: |-
|
||||
$Package = 'Microsoft.Internal.Windows.Terminal.TestContent'
|
||||
|
||||
@@ -210,8 +210,6 @@ extends:
|
||||
ob_createvpack_taskLogVerbosity: Detailed
|
||||
ob_createvpack_verbose: true
|
||||
ob_createvpack_vpackdirectory: '$(JobOutputDirectory)\vpack'
|
||||
ob_createvpack_versionAs: string
|
||||
ob_createvpack_version: '$(XES_PACKAGEVERSIONNUMBER)'
|
||||
ob_updateOSManifest_gitcheckinConfigPath: '$(Build.SourcesDirectory)\build\config\GitCheckin.json'
|
||||
# We're skipping the 'fetch' part of the OneBranch rules, but that doesn't mean
|
||||
# that it doesn't expect to have downloaded a manifest directly to some 'destination'
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
parameters:
|
||||
- name: forceNugetInstallation
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
steps:
|
||||
- ${{ if and(ne(parameters.forceNugetInstallation, true), eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564')) }}:
|
||||
- ${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
|
||||
- pwsh: |-
|
||||
Write-Host "Assuming NuGet is already installed..."
|
||||
& nuget.exe help
|
||||
@@ -12,6 +7,6 @@ steps:
|
||||
|
||||
- ${{ else }}:
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Use NuGet 7.0.1
|
||||
displayName: Use NuGet 6.6.1
|
||||
inputs:
|
||||
versionSpec: 7.0.1
|
||||
versionSpec: 6.6.1
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -77,6 +77,9 @@
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\WindowsTerminal\WindowsTerminal.vcxproj">
|
||||
<Project>{CA5CAD1A-1754-4A9D-93D7-857A9D17CB1B}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalAzBridge\TerminalAzBridge.vcxproj">
|
||||
<Project>{067F0A06-FCB7-472C-96E9-B03B54E8E18D}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\ShellExtension\WindowsTerminalShellExt.vcxproj">
|
||||
<Project>{f2ed628a-db22-446f-a081-4cc845b51a2b}</Project>
|
||||
</ProjectReference>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -900,10 +903,7 @@ namespace winrt::TerminalApp::implementation
|
||||
co_return;
|
||||
}
|
||||
|
||||
// ShellExecuteExW may block, so do it on a background thread.
|
||||
//
|
||||
// NOTE: All remaining code of this function doesn't touch `this`, so we don't need weak/strong_ref.
|
||||
// NOTE NOTE: Don't touch `this` when you make changes here.
|
||||
// Hop to the BG thread
|
||||
co_await winrt::resume_background();
|
||||
|
||||
// This will get us the correct exe for dev/preview/release. If you
|
||||
@@ -1456,8 +1456,6 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
safe_void_coroutine TerminalPage::_doHandleSuggestions(SuggestionsArgs realArgs)
|
||||
{
|
||||
const auto weak = get_weak();
|
||||
const auto dispatcher = Dispatcher();
|
||||
const auto source = realArgs.Source();
|
||||
std::vector<Command> commandsCollection;
|
||||
Control::CommandHistoryContext context{ nullptr };
|
||||
@@ -1524,12 +1522,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
co_await wil::resume_foreground(dispatcher);
|
||||
const auto strong = weak.get();
|
||||
if (!strong)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
co_await wil::resume_foreground(Dispatcher());
|
||||
|
||||
// Open the palette with all these commands in it.
|
||||
_OpenSuggestions(_GetActiveControl(),
|
||||
|
||||
@@ -150,9 +150,7 @@ namespace winrt::TerminalApp::implementation
|
||||
});
|
||||
|
||||
_languageProfileNotifier = winrt::make_self<LanguageProfileNotifier>([this]() {
|
||||
// TODO: This is really bad, because we reset any current user customizations.
|
||||
// See GH#11522.
|
||||
ReloadSettingsThrottled();
|
||||
_reloadSettings->Run();
|
||||
});
|
||||
|
||||
// Do this here, rather than at the top of main. This will prevent us from
|
||||
@@ -332,7 +330,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
if (modifiedBasename == settingsBasename)
|
||||
{
|
||||
ReloadSettingsThrottled();
|
||||
_reloadSettings->Run();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -438,11 +436,6 @@ namespace winrt::TerminalApp::implementation
|
||||
SettingsChanged.raise(*this, *ev);
|
||||
}
|
||||
|
||||
void AppLogic::ReloadSettingsThrottled()
|
||||
{
|
||||
_reloadSettings->Run();
|
||||
}
|
||||
|
||||
// This is a continuation of AppLogic::Create() and includes the more expensive parts.
|
||||
void AppLogic::NotifyRootInitialized()
|
||||
{
|
||||
|
||||
@@ -36,7 +36,6 @@ namespace winrt::TerminalApp::implementation
|
||||
bool IsRunningElevated() const noexcept;
|
||||
bool CanDragDrop() const noexcept;
|
||||
void ReloadSettings();
|
||||
void ReloadSettingsThrottled();
|
||||
void NotifyRootInitialized();
|
||||
|
||||
bool HasSettingsStartupActions() const noexcept;
|
||||
@@ -81,6 +80,7 @@ namespace winrt::TerminalApp::implementation
|
||||
[[nodiscard]] HRESULT _TryLoadSettings() noexcept;
|
||||
void _ProcessLazySettingsChanges();
|
||||
void _RegisterSettingsChange();
|
||||
safe_void_coroutine _DispatchReloadSettings();
|
||||
|
||||
void _setupFolderPathEnvVar();
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace TerminalApp
|
||||
Boolean HasSettingsStartupActions();
|
||||
|
||||
void ReloadSettings();
|
||||
void ReloadSettingsThrottled();
|
||||
Microsoft.Terminal.Settings.Model.CascadiaSettings Settings { get; };
|
||||
|
||||
TerminalWindow CreateNewWindow();
|
||||
|
||||
@@ -929,17 +929,6 @@ namespace winrt::TerminalApp::implementation
|
||||
void CommandPalette::_filterTextChanged(const IInspectable& /*sender*/,
|
||||
const Windows::UI::Xaml::RoutedEventArgs& /*args*/)
|
||||
{
|
||||
// GH#18737: Only respond to this change if we are visible:
|
||||
// _close calls _searchBox().Text(L"") to reset the search text, which lands us
|
||||
// in here after the command palette is dismissed. Since we have a code path here that
|
||||
// could potentially lead to an action being previewed (specifically if there is a
|
||||
// preview-able action as the first entry in the command list), that preview will
|
||||
// appear after the palette is dismissed without this check.
|
||||
if (Visibility() != Visibility::Visible)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// When we are executing the _SelectNextTab in the TabManagement.cpp, this method
|
||||
// is getting triggered because we set up the default value for that CommandPalette
|
||||
// with an empty string. Therefore, to avoid the reset of the index when executing
|
||||
|
||||
@@ -34,15 +34,9 @@ namespace winrt::Microsoft::TerminalApp::implementation
|
||||
// before actually starting the connection to the client app. This
|
||||
// will ensure both controls are initialized before the client app
|
||||
// is.
|
||||
const auto weak = get_weak();
|
||||
co_await winrt::resume_background();
|
||||
const auto strong = weak.get();
|
||||
if (!strong)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
_pairedTap->_start.wait();
|
||||
|
||||
_wrappedConnection.Start();
|
||||
}
|
||||
void WriteInput(const winrt::array_view<const char16_t> buffer)
|
||||
|
||||
@@ -43,9 +43,6 @@ safe_void_coroutine Jumplist::UpdateJumplist(const CascadiaSettings& settings) n
|
||||
// make sure to capture the settings _before_ the co_await
|
||||
const auto strongSettings = settings;
|
||||
|
||||
// Explorer APIs may block, so do it on a background thread.
|
||||
//
|
||||
// NOTE: Jumplist has no members, so we don't need to hold onto `this` here.
|
||||
co_await winrt::resume_background();
|
||||
|
||||
try
|
||||
|
||||
@@ -89,18 +89,6 @@ namespace winrt::TerminalApp::implementation
|
||||
CloseClick.raise(*this, e);
|
||||
}
|
||||
|
||||
bool MinMaxCloseControl::Focused() const
|
||||
{
|
||||
return _focused;
|
||||
}
|
||||
|
||||
void MinMaxCloseControl::Focused(bool focused)
|
||||
{
|
||||
_focused = focused;
|
||||
|
||||
ReleaseButtons();
|
||||
}
|
||||
|
||||
void MinMaxCloseControl::SetWindowVisualState(WindowVisualState visualState)
|
||||
{
|
||||
// Look up the heights we should use for the caption buttons from our
|
||||
@@ -182,25 +170,25 @@ namespace winrt::TerminalApp::implementation
|
||||
// animate the fade in/out transition between colors.
|
||||
case CaptionButton::Minimize:
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"PointerOver", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
|
||||
_displayToolTip->Run(MinimizeButton());
|
||||
closeToolTipForButton(MaximizeButton());
|
||||
closeToolTipForButton(CloseButton());
|
||||
break;
|
||||
case CaptionButton::Maximize:
|
||||
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"PointerOver", true);
|
||||
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
|
||||
closeToolTipForButton(MinimizeButton());
|
||||
_displayToolTip->Run(MaximizeButton());
|
||||
closeToolTipForButton(CloseButton());
|
||||
break;
|
||||
case CaptionButton::Close:
|
||||
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"PointerOver", true);
|
||||
|
||||
closeToolTipForButton(MinimizeButton());
|
||||
@@ -223,17 +211,17 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
case CaptionButton::Minimize:
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Pressed", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
break;
|
||||
case CaptionButton::Maximize:
|
||||
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Pressed", true);
|
||||
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
break;
|
||||
case CaptionButton::Close:
|
||||
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Pressed", true);
|
||||
break;
|
||||
}
|
||||
@@ -246,9 +234,9 @@ namespace winrt::TerminalApp::implementation
|
||||
void MinMaxCloseControl::ReleaseButtons()
|
||||
{
|
||||
_displayToolTip->Run(nullptr);
|
||||
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
|
||||
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
|
||||
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
|
||||
|
||||
closeToolTipForButton(MinimizeButton());
|
||||
closeToolTipForButton(MaximizeButton());
|
||||
@@ -256,11 +244,4 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
_lastPressedButton = std::nullopt;
|
||||
}
|
||||
|
||||
const winrt::param::hstring& MinMaxCloseControl::_normalState() const
|
||||
{
|
||||
static const winrt::param::hstring normal = L"Normal";
|
||||
static const winrt::param::hstring unfocused = L"Unfocused";
|
||||
return (_focused ? normal : unfocused);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,6 @@ namespace winrt::TerminalApp::implementation
|
||||
void PressButton(CaptionButton button);
|
||||
void ReleaseButtons();
|
||||
|
||||
bool Focused() const;
|
||||
void Focused(bool focused);
|
||||
|
||||
void _MinimizeClick(const winrt::Windows::Foundation::IInspectable& sender,
|
||||
const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
|
||||
void _MaximizeClick(const winrt::Windows::Foundation::IInspectable& sender,
|
||||
@@ -35,12 +32,8 @@ namespace winrt::TerminalApp::implementation
|
||||
til::typed_event<TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs> MaximizeClick;
|
||||
til::typed_event<TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs> CloseClick;
|
||||
|
||||
bool _focused{ false };
|
||||
std::shared_ptr<ThrottledFunc<winrt::Windows::UI::Xaml::Controls::Button>> _displayToolTip{ nullptr };
|
||||
std::optional<CaptionButton> _lastPressedButton{ std::nullopt };
|
||||
|
||||
private:
|
||||
const winrt::param::hstring& _normalState() const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace TerminalApp
|
||||
void HoverButton(CaptionButton button);
|
||||
void PressButton(CaptionButton button);
|
||||
void ReleaseButtons();
|
||||
Boolean Focused { get; set; };
|
||||
|
||||
event Windows.Foundation.TypedEventHandler<MinMaxCloseControl, Windows.UI.Xaml.RoutedEventArgs> MinimizeClick;
|
||||
event Windows.Foundation.TypedEventHandler<MinMaxCloseControl, Windows.UI.Xaml.RoutedEventArgs> MaximizeClick;
|
||||
|
||||
@@ -32,10 +32,6 @@
|
||||
ResourceKey="SystemControlForegroundBaseHighBrush" />
|
||||
<StaticResource x:Key="CaptionButtonForegroundPressed"
|
||||
ResourceKey="SystemControlForegroundBaseHighBrush" />
|
||||
<StaticResource x:Key="CaptionButtonForegroundUnfocusedColor"
|
||||
ResourceKey="TextFillColorDisabled" />
|
||||
<SolidColorBrush x:Key="CaptionButtonForegroundUnfocused"
|
||||
Color="{ThemeResource CaptionButtonForegroundUnfocusedColor}" />
|
||||
<SolidColorBrush x:Key="CaptionButtonBackground"
|
||||
Color="Transparent" />
|
||||
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color>
|
||||
@@ -70,10 +66,6 @@
|
||||
ResourceKey="SystemControlForegroundBaseHighBrush" />
|
||||
<StaticResource x:Key="CaptionButtonForegroundPressed"
|
||||
ResourceKey="SystemControlForegroundBaseHighBrush" />
|
||||
<StaticResource x:Key="CaptionButtonForegroundUnfocusedColor"
|
||||
ResourceKey="TextFillColorDisabled" />
|
||||
<SolidColorBrush x:Key="CaptionButtonForegroundUnfocused"
|
||||
Color="{ThemeResource CaptionButtonForegroundUnfocusedColor}" />
|
||||
<SolidColorBrush x:Key="CaptionButtonBackground"
|
||||
Color="Transparent" />
|
||||
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color>
|
||||
@@ -111,10 +103,6 @@
|
||||
Color="{ThemeResource SystemColorHighlightTextColor}" />
|
||||
<SolidColorBrush x:Key="CaptionButtonForegroundPressed"
|
||||
Color="{ThemeResource SystemColorHighlightTextColor}" />
|
||||
<SolidColorBrush x:Key="CaptionButtonForegroundUnfocused"
|
||||
Color="{ThemeResource SystemColorButtonTextColor}" />
|
||||
<StaticResource x:Key="CaptionButtonForegroundUnfocusedColor"
|
||||
ResourceKey="SystemColorButtonTextColor" />
|
||||
<SolidColorBrush x:Key="CloseButtonBackgroundPointerOver"
|
||||
Color="{ThemeResource SystemColorHighlightColor}" />
|
||||
<SolidColorBrush x:Key="CloseButtonForegroundPointerOver"
|
||||
@@ -201,20 +189,6 @@
|
||||
Duration="0:0:0.1" />
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
|
||||
<VisualTransition From="PointerOver"
|
||||
To="Unfocused">
|
||||
<Storyboard>
|
||||
<ColorAnimation Storyboard.TargetName="ButtonBaseElement"
|
||||
Storyboard.TargetProperty="(UIElement.Background).(SolidColorBrush.Color)"
|
||||
To="{ThemeResource CaptionButtonBackgroundColor}"
|
||||
Duration="0:0:0.15" />
|
||||
<ColorAnimation Storyboard.TargetName="ButtonIcon"
|
||||
Storyboard.TargetProperty="(UIElement.Foreground).(SolidColorBrush.Color)"
|
||||
To="{ThemeResource CaptionButtonForegroundUnfocusedColor}"
|
||||
Duration="0:0:0.1" />
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
</VisualStateGroup.Transitions>
|
||||
|
||||
<VisualState x:Name="Normal">
|
||||
@@ -224,13 +198,6 @@
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Unfocused">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackground}" />
|
||||
<Setter Target="ButtonIcon.Foreground" Value="{ThemeResource CaptionButtonForegroundUnfocused}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackgroundPointerOver}" />
|
||||
|
||||
@@ -887,7 +887,7 @@
|
||||
<value>Déplacer l'onglet vers une nouvelle fenêtre </value>
|
||||
</data>
|
||||
<data name="RunAsAdminFlyout.Text" xml:space="preserve">
|
||||
<value>Exécuter en tant qu'administrateur (restreint)</value>
|
||||
<value>Exécuter en temps qu'administrateur (restreint)</value>
|
||||
<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">
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
<value>同じ名前ですが大文字と小文字が異なる環境変数が複数見つかりました。使用される値は 1 つだけです。</value>
|
||||
</data>
|
||||
<data name="CmdCommandArgDesc" xml:space="preserve">
|
||||
<value>新しいタブまたはペインで生成されるオプションのコマンドと引数</value>
|
||||
<value>新しいタブまたはウィンドウで生成されるオプションのコマンドと引数</value>
|
||||
</data>
|
||||
<data name="SaveSnippetDesc" xml:space="preserve">
|
||||
<value>コマンド ラインを入力アクションとして保存する</value>
|
||||
@@ -412,7 +412,7 @@
|
||||
<comment>{Locked="\"tabTitle\""}</comment>
|
||||
</data>
|
||||
<data name="CmdInheritEnvDesc" xml:space="preserve">
|
||||
<value>新しい環境ブロックを作成するのではなく、新しいタブまたはペインを作成するときに、ターミナル独自の環境変数を継承します。これは、"command" が渡されたときに既定で設定されます。 </value>
|
||||
<value>新しい環境ブロックを作成するのではなく、新しいタブまたはウィンドウを作成するときに、ターミナル独自の環境変数を継承します。これは、"command" が渡されたときに既定で設定されます。 </value>
|
||||
<comment>{Locked="\"command\""}</comment>
|
||||
</data>
|
||||
<data name="CmdColorSchemeArgDesc" xml:space="preserve">
|
||||
@@ -429,7 +429,7 @@
|
||||
<value>ウィンドウを全画面表示モードで起動する</value>
|
||||
</data>
|
||||
<data name="CmdMoveFocusDesc" xml:space="preserve">
|
||||
<value>指定した方向にある隣のペインにフォーカスを移動する</value>
|
||||
<value>指定した方向にある隣のウィンドウにフォーカスを移動する</value>
|
||||
</data>
|
||||
<data name="CmdMFDesc" xml:space="preserve">
|
||||
<value>"move-focus" サブコマンドのエイリアス。</value>
|
||||
@@ -857,7 +857,7 @@
|
||||
<value>設定ページを開きます</value>
|
||||
</data>
|
||||
<data name="SplitTabToolTip" xml:space="preserve">
|
||||
<value>現在のディレクトリのアクティブなプロファイルを使用して新しいペインを開きます</value>
|
||||
<value>現在のディレクトリのアクティブなプロファイルを使用して新しいウィンドウを開きます</value>
|
||||
</data>
|
||||
<data name="TabCloseAfterToolTip" xml:space="preserve">
|
||||
<value>このタブの右側にあるすべてのタブを閉じます</value>
|
||||
@@ -930,7 +930,7 @@
|
||||
<value>接続の再起動</value>
|
||||
</data>
|
||||
<data name="RestartConnectionToolTip" xml:space="preserve">
|
||||
<value>アクティブ ペイン接続を再起動します</value>
|
||||
<value>アクティブウィンドウ接続を再起動します</value>
|
||||
</data>
|
||||
<data name="SnippetPaneTitle.Text" xml:space="preserve">
|
||||
<value>抜粋</value>
|
||||
|
||||
@@ -48,22 +48,13 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
_settings = settings;
|
||||
|
||||
const auto dispatcher = Dispatcher();
|
||||
const auto weak = get_weak();
|
||||
|
||||
// You'd think that `FilterToSendInput(queryString)` would work. It
|
||||
// doesn't! That uses the queryString as the current command the user
|
||||
// has typed, then relies on the suggestions UI to _also_ filter with that
|
||||
// string.
|
||||
|
||||
const auto tasks = co_await _settings.GlobalSettings().ActionMap().FilterToSnippets(winrt::hstring{}, winrt::hstring{}); // IVector<Model::Command>
|
||||
co_await wil::resume_foreground(dispatcher);
|
||||
|
||||
const auto strong = weak.get();
|
||||
if (!strong)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
co_await wil::resume_foreground(Dispatcher());
|
||||
|
||||
_allTasks.Clear();
|
||||
for (const auto& t : tasks)
|
||||
|
||||
@@ -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))
|
||||
@@ -397,18 +398,12 @@ namespace winrt::TerminalApp::implementation
|
||||
// - tab: the tab to remove
|
||||
winrt::Windows::Foundation::IAsyncAction TerminalPage::_HandleCloseTabRequested(winrt::TerminalApp::Tab tab)
|
||||
{
|
||||
winrt::com_ptr<TerminalPage> strong;
|
||||
|
||||
if (tab.ReadOnly())
|
||||
{
|
||||
const auto weak = get_weak();
|
||||
|
||||
auto warningResult = co_await _ShowCloseReadOnlyDialog();
|
||||
|
||||
strong = weak.get();
|
||||
|
||||
// If the user didn't explicitly click on close tab - leave
|
||||
if (!strong || warningResult != ContentDialogResult::Primary)
|
||||
if (warningResult != ContentDialogResult::Primary)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
@@ -719,14 +714,10 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
if (pane->ContainsReadOnly())
|
||||
{
|
||||
const auto weak = get_weak();
|
||||
|
||||
auto warningResult = co_await _ShowCloseReadOnlyDialog();
|
||||
|
||||
const auto strong = weak.get();
|
||||
|
||||
// If the user didn't explicitly click on close tab - leave
|
||||
if (!strong || warningResult != ContentDialogResult::Primary)
|
||||
if (warningResult != ContentDialogResult::Primary)
|
||||
{
|
||||
co_return false;
|
||||
}
|
||||
@@ -784,13 +775,9 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
if (const auto pane{ activeTab->GetActivePane() })
|
||||
{
|
||||
const auto weak = get_weak();
|
||||
if (co_await _PaneConfirmCloseReadOnly(pane))
|
||||
{
|
||||
if (const auto strong = weak.get())
|
||||
{
|
||||
_HandleClosePaneRequested(pane);
|
||||
}
|
||||
_HandleClosePaneRequested(pane);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -848,22 +835,9 @@ namespace winrt::TerminalApp::implementation
|
||||
// - tabs - tabs to remove
|
||||
safe_void_coroutine TerminalPage::_RemoveTabs(const std::vector<winrt::TerminalApp::Tab> tabs)
|
||||
{
|
||||
const auto weak = get_weak();
|
||||
|
||||
for (auto& tab : tabs)
|
||||
{
|
||||
winrt::Windows::Foundation::IAsyncAction action{ nullptr };
|
||||
if (const auto strong = weak.get())
|
||||
{
|
||||
action = _HandleCloseTabRequested(tab);
|
||||
}
|
||||
|
||||
if (!action)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
co_await action;
|
||||
co_await _HandleCloseTabRequested(tab);
|
||||
}
|
||||
}
|
||||
// Method Description:
|
||||
@@ -947,13 +921,8 @@ namespace winrt::TerminalApp::implementation
|
||||
// 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 weak = get_weak();
|
||||
const auto strong = get_strong();
|
||||
co_await wil::resume_foreground(Dispatcher());
|
||||
const auto strong = weak.get();
|
||||
if (!strong)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
const auto tab = _GetTabByTabViewItem(sender);
|
||||
if (!tab)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <LibraryResources.h>
|
||||
#include <TerminalThemeHelpers.h>
|
||||
#include <til/unicode.h>
|
||||
#include <Utils.h>
|
||||
#include <TerminalCore/ControlKeyStates.hpp>
|
||||
|
||||
@@ -22,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"
|
||||
@@ -260,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;
|
||||
}
|
||||
@@ -281,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;
|
||||
|
||||
@@ -452,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()
|
||||
@@ -1465,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 {
|
||||
@@ -1490,8 +1491,18 @@ namespace winrt::TerminalApp::implementation
|
||||
if (connectionType == TerminalConnection::AzureConnection::ConnectionType() &&
|
||||
TerminalConnection::AzureConnection::IsAzureConnectionAvailable())
|
||||
{
|
||||
connection = TerminalConnection::AzureConnection{};
|
||||
valueSet = TerminalConnection::ConptyConnection::CreateSettings(winrt::hstring{},
|
||||
std::filesystem::path azBridgePath{ wil::GetModuleFileNameW<std::wstring>(nullptr) };
|
||||
azBridgePath.replace_filename(L"TerminalAzBridge.exe");
|
||||
if constexpr (Feature_AzureConnectionInProc::IsEnabled())
|
||||
{
|
||||
connection = TerminalConnection::AzureConnection{};
|
||||
}
|
||||
else
|
||||
{
|
||||
connection = TerminalConnection::ConptyConnection{};
|
||||
}
|
||||
|
||||
valueSet = TerminalConnection::ConptyConnection::CreateSettings(azBridgePath.native(),
|
||||
L".",
|
||||
L"Azure",
|
||||
false,
|
||||
@@ -1505,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.
|
||||
//
|
||||
@@ -1529,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(),
|
||||
@@ -1583,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
|
||||
@@ -1604,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:
|
||||
@@ -2206,15 +2216,7 @@ namespace winrt::TerminalApp::implementation
|
||||
if (!_displayingCloseDialog)
|
||||
{
|
||||
_displayingCloseDialog = true;
|
||||
|
||||
const auto weak = get_weak();
|
||||
auto warningResult = co_await _ShowQuitDialog();
|
||||
const auto strong = weak.get();
|
||||
if (!strong)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
_displayingCloseDialog = false;
|
||||
|
||||
if (warningResult != ContentDialogResult::Primary)
|
||||
@@ -2942,11 +2944,7 @@ namespace winrt::TerminalApp::implementation
|
||||
text = winrt::hstring{ Utils::TrimPaste(text) };
|
||||
}
|
||||
|
||||
// LOAD BEARING: Send an empty bracketed paste even if the clipboard was empty.
|
||||
// Bracketed Paste provides an application a way to know whether the
|
||||
// user pasted, even if there was no applicable content on it. This
|
||||
// behavior is observed in GNOME Terminal, among others.
|
||||
if (!bracketedPaste && text.empty())
|
||||
if (text.empty())
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
@@ -2985,19 +2983,7 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// We have to initialize the dialog here to be able to change the text of the text block within it
|
||||
std::ignore = FindName(L"MultiLinePasteDialog");
|
||||
|
||||
// WinUI absolutely cannot deal with large amounts of text (at least O(n), possibly O(n^2),
|
||||
// so we limit the string length here and add an ellipsis if necessary.
|
||||
auto clipboardText = text;
|
||||
if (clipboardText.size() > 1024)
|
||||
{
|
||||
const std::wstring_view view{ text };
|
||||
// Make sure we don't cut in the middle of a surrogate pair
|
||||
const auto len = til::utf16_iterate_prev(view, 512);
|
||||
clipboardText = til::hstring_format(FMT_COMPILE(L"{}\n…"), view.substr(0, len));
|
||||
}
|
||||
|
||||
ClipboardText().Text(std::move(clipboardText));
|
||||
ClipboardText().Text(text);
|
||||
|
||||
// The vertical offset on the scrollbar does not reset automatically, so reset it manually
|
||||
ClipboardContentScrollViewer().ScrollToVerticalOffset(0);
|
||||
@@ -3013,7 +2999,7 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
|
||||
// Clear the clipboard text so it doesn't lie around in memory
|
||||
ClipboardText().Text({});
|
||||
ClipboardText().Text(L"");
|
||||
|
||||
if (warningResult != ContentDialogResult::Primary)
|
||||
{
|
||||
@@ -3193,12 +3179,8 @@ namespace winrt::TerminalApp::implementation
|
||||
// - eventArgs: the arguments specifying how to set the progress indicator
|
||||
safe_void_coroutine TerminalPage::_SetTaskbarProgressHandler(const IInspectable /*sender*/, const IInspectable /*eventArgs*/)
|
||||
{
|
||||
const auto weak = get_weak();
|
||||
co_await wil::resume_foreground(Dispatcher());
|
||||
if (const auto strong = weak.get())
|
||||
{
|
||||
SetTaskbarProgress.raise(*this, nullptr);
|
||||
}
|
||||
SetTaskbarProgress.raise(*this, nullptr);
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
@@ -3255,12 +3237,6 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
const auto weak = get_weak();
|
||||
const auto dispatcher = Dispatcher();
|
||||
|
||||
// All of the code until resume_foreground is static and
|
||||
// doesn't touch `this`, so we don't need weak/strong_ref.
|
||||
co_await winrt::resume_background();
|
||||
|
||||
// no packages were found, nothing to suggest
|
||||
@@ -3278,12 +3254,7 @@ namespace winrt::TerminalApp::implementation
|
||||
suggestions.emplace_back(fmt::format(FMT_COMPILE(L"winget install --id {} -s winget"), pkg.CatalogPackage().Id()));
|
||||
}
|
||||
|
||||
co_await wil::resume_foreground(dispatcher);
|
||||
const auto strong = weak.get();
|
||||
if (!strong)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
co_await wil::resume_foreground(Dispatcher());
|
||||
|
||||
auto term = _GetActiveControl();
|
||||
if (!term)
|
||||
@@ -3378,9 +3349,6 @@ namespace winrt::TerminalApp::implementation
|
||||
// UI) thread. This is IMPORTANT, because the Windows.Storage API's
|
||||
// (used for retrieving the path to the file) will crash on the UI
|
||||
// thread, because the main thread is a STA.
|
||||
//
|
||||
// NOTE: All remaining code of this function doesn't touch `this`, so we don't need weak/strong_ref.
|
||||
// NOTE NOTE: Don't touch `this` when you make changes here.
|
||||
co_await winrt::resume_background();
|
||||
|
||||
auto openFile = [](const auto& filePath) {
|
||||
@@ -3435,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);
|
||||
}
|
||||
@@ -3455,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;
|
||||
}
|
||||
@@ -3475,6 +3441,8 @@ namespace winrt::TerminalApp::implementation
|
||||
term.OwningHwnd(reinterpret_cast<uint64_t>(*_hostingHwnd));
|
||||
}
|
||||
|
||||
term.KeyBindings(*_bindings);
|
||||
|
||||
_RegisterTerminalEvents(term);
|
||||
return term;
|
||||
}
|
||||
@@ -3511,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) })
|
||||
@@ -3521,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
|
||||
@@ -3542,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 };
|
||||
@@ -3707,13 +3675,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// for nulls
|
||||
if (const auto& connection{ _duplicateConnectionForRestart(paneContent) })
|
||||
{
|
||||
// Reset the terminal's VT state before attaching the new connection.
|
||||
// The previous client may have left dirty modes (e.g., bracketed
|
||||
// paste, mouse tracking, alternate buffer, kitty keyboard) that
|
||||
// would corrupt input/output for the new shell process.
|
||||
const auto& termControl = paneContent.GetTermControl();
|
||||
termControl.HardResetWithoutErase();
|
||||
termControl.Connection(connection);
|
||||
paneContent.GetTermControl().Connection(connection);
|
||||
connection.Start();
|
||||
}
|
||||
}
|
||||
@@ -3798,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)
|
||||
{
|
||||
@@ -4709,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.
|
||||
@@ -4722,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;
|
||||
}
|
||||
@@ -4732,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;
|
||||
}
|
||||
@@ -4745,18 +4707,12 @@ namespace winrt::TerminalApp::implementation
|
||||
// - sender: the ICoreState instance containing the connection state
|
||||
// Return Value:
|
||||
// - <none>
|
||||
safe_void_coroutine TerminalPage::_ConnectionStateChangedHandler(const IInspectable& sender, const IInspectable& /*args*/)
|
||||
safe_void_coroutine TerminalPage::_ConnectionStateChangedHandler(const IInspectable& sender, const IInspectable& /*args*/) const
|
||||
{
|
||||
if (const auto coreState{ sender.try_as<winrt::Microsoft::Terminal::Control::ICoreState>() })
|
||||
{
|
||||
const auto newConnectionState = coreState.ConnectionState();
|
||||
const auto weak = get_weak();
|
||||
co_await wil::resume_foreground(Dispatcher());
|
||||
const auto strong = weak.get();
|
||||
if (!strong)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
_adjustProcessPriorityThrottled->Run();
|
||||
|
||||
@@ -4894,18 +4850,8 @@ namespace winrt::TerminalApp::implementation
|
||||
}
|
||||
}
|
||||
|
||||
// GH#19604: Get the theme's tabRow color to use as the acrylic tint.
|
||||
const auto tabRowBg{ theme.TabRow() ? (_activated ? theme.TabRow().Background() :
|
||||
theme.TabRow().UnfocusedBackground()) :
|
||||
ThemeColor{ nullptr } };
|
||||
|
||||
if (_settings.GlobalSettings().UseAcrylicInTabRow() && (_activated || _settings.GlobalSettings().EnableUnfocusedAcrylic()))
|
||||
if (_settings.GlobalSettings().UseAcrylicInTabRow())
|
||||
{
|
||||
if (tabRowBg)
|
||||
{
|
||||
bgColor = ThemeColor::ColorFromBrush(tabRowBg.Evaluate(res, terminalBrush, true));
|
||||
}
|
||||
|
||||
const auto acrylicBrush = Media::AcrylicBrush();
|
||||
acrylicBrush.BackgroundSource(Media::AcrylicBackgroundSource::HostBackdrop);
|
||||
acrylicBrush.FallbackColor(bgColor);
|
||||
@@ -4914,7 +4860,9 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
TitlebarBrush(acrylicBrush);
|
||||
}
|
||||
else if (tabRowBg)
|
||||
else if (auto tabRowBg{ theme.TabRow() ? (_activated ? theme.TabRow().Background() :
|
||||
theme.TabRow().UnfocusedBackground()) :
|
||||
ThemeColor{ nullptr } })
|
||||
{
|
||||
const auto themeBrush{ tabRowBg.Evaluate(res, terminalBrush, true) };
|
||||
bgColor = ThemeColor::ColorFromBrush(themeBrush);
|
||||
|
||||
@@ -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&);
|
||||
|
||||
@@ -461,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);
|
||||
@@ -516,11 +521,11 @@ 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);
|
||||
|
||||
safe_void_coroutine _ConnectionStateChangedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args);
|
||||
safe_void_coroutine _ConnectionStateChangedHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args) const;
|
||||
void _CloseOnExitInfoDismissHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args) const;
|
||||
void _KeyboardServiceWarningInfoDismissHandler(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::Foundation::IInspectable& args) const;
|
||||
static bool _IsMessageDismissed(const winrt::Microsoft::Terminal::Settings::Model::InfoBarMessage& message);
|
||||
@@ -536,7 +541,7 @@ namespace winrt::TerminalApp::implementation
|
||||
|
||||
void _ShowWindowChangedHandler(const IInspectable sender, const winrt::Microsoft::Terminal::Control::ShowWindowArgs args);
|
||||
Windows::Foundation::IAsyncAction _SearchMissingCommandHandler(const IInspectable sender, const winrt::Microsoft::Terminal::Control::SearchMissingCommandEventArgs args);
|
||||
static Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<winrt::Microsoft::Management::Deployment::MatchResult>> _FindPackageAsync(hstring query);
|
||||
Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<winrt::Microsoft::Management::Deployment::MatchResult>> _FindPackageAsync(hstring query);
|
||||
|
||||
void _WindowSizeChanged(const IInspectable sender, const winrt::Microsoft::Terminal::Control::WindowSizeChangedEventArgs args);
|
||||
void _windowPropertyChanged(const IInspectable& sender, const winrt::Windows::UI::Xaml::Data::PropertyChangedEventArgs& args);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -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;
|
||||
@@ -322,10 +324,6 @@ namespace winrt::TerminalApp::implementation
|
||||
// - an IAsyncOperation with the dialog result
|
||||
winrt::Windows::Foundation::IAsyncOperation<ContentDialogResult> TerminalWindow::ShowDialog(winrt::WUX::Controls::ContentDialog dialog)
|
||||
{
|
||||
const auto weak = get_weak();
|
||||
const auto dispatcher = _root->Dispatcher();
|
||||
const auto root = _root->XamlRoot();
|
||||
|
||||
// As mentioned on s_activeDialog, dismissing the active dialog is necessary.
|
||||
// We repeat it a few times in case the resume_foreground failed to work,
|
||||
// but I found that one iteration will always be enough in practice.
|
||||
@@ -339,7 +337,7 @@ namespace winrt::TerminalApp::implementation
|
||||
s_activeDialog.Hide();
|
||||
|
||||
// Wait for the current dialog to be hidden.
|
||||
co_await wil::resume_foreground(dispatcher, CoreDispatcherPriority::Low);
|
||||
co_await wil::resume_foreground(_root->Dispatcher(), CoreDispatcherPriority::Low);
|
||||
}
|
||||
|
||||
// If two sources call ShowDialog() simultaneously, it may happen that both enter the above loop,
|
||||
@@ -356,7 +354,7 @@ namespace winrt::TerminalApp::implementation
|
||||
// IMPORTANT: This is necessary as documented in the ContentDialog MSDN docs.
|
||||
// Since we're hosting the dialog in a Xaml island, we need to connect it to the
|
||||
// xaml tree somehow.
|
||||
dialog.XamlRoot(root);
|
||||
dialog.XamlRoot(_root->XamlRoot());
|
||||
|
||||
// IMPORTANT: Set the requested theme of the dialog, because the
|
||||
// PopupRoot isn't directly in the Xaml tree of our root. So the dialog
|
||||
@@ -370,17 +368,14 @@ namespace winrt::TerminalApp::implementation
|
||||
// theme on each element up to the root. We're relying a bit on Xaml's implementation
|
||||
// details here, but it does have the desired effect.
|
||||
// It's not enough to set the theme on the dialog alone.
|
||||
auto themingLambda{ [weak](const Windows::Foundation::IInspectable& sender, const RoutedEventArgs&) {
|
||||
if (const auto strong = weak.get())
|
||||
auto themingLambda{ [this](const Windows::Foundation::IInspectable& sender, const RoutedEventArgs&) {
|
||||
auto theme{ _settings.GlobalSettings().CurrentTheme() };
|
||||
auto requestedTheme{ theme.RequestedTheme() };
|
||||
auto element{ sender.try_as<winrt::Windows::UI::Xaml::FrameworkElement>() };
|
||||
while (element)
|
||||
{
|
||||
auto theme{ strong->_settings.GlobalSettings().CurrentTheme() };
|
||||
auto requestedTheme{ theme.RequestedTheme() };
|
||||
auto element{ sender.try_as<winrt::Windows::UI::Xaml::FrameworkElement>() };
|
||||
while (element)
|
||||
{
|
||||
element.RequestedTheme(requestedTheme);
|
||||
element = element.Parent().try_as<winrt::Windows::UI::Xaml::FrameworkElement>();
|
||||
}
|
||||
element.RequestedTheme(requestedTheme);
|
||||
element = element.Parent().try_as<winrt::Windows::UI::Xaml::FrameworkElement>();
|
||||
}
|
||||
} };
|
||||
|
||||
@@ -620,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);
|
||||
@@ -895,11 +890,6 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
// Manually bubble the OnDirectKeyEvent event up through the focus tree.
|
||||
auto xamlRoot{ _root->XamlRoot() };
|
||||
if (!xamlRoot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto focusedObject{ Windows::UI::Xaml::Input::FocusManager::GetFocusedElement(xamlRoot) };
|
||||
do
|
||||
{
|
||||
|
||||
@@ -53,16 +53,6 @@ namespace winrt::TerminalApp::implementation
|
||||
return static_cast<float>(minMaxCloseWidth) / 3.0f;
|
||||
}
|
||||
|
||||
bool TitlebarControl::Focused()
|
||||
{
|
||||
return MinMaxCloseControl().Focused();
|
||||
}
|
||||
|
||||
void TitlebarControl::Focused(bool focused)
|
||||
{
|
||||
MinMaxCloseControl().Focused(focused);
|
||||
}
|
||||
|
||||
IInspectable TitlebarControl::Content()
|
||||
{
|
||||
return ContentRoot().Content();
|
||||
|
||||
@@ -17,9 +17,6 @@ namespace winrt::TerminalApp::implementation
|
||||
void ReleaseButtons();
|
||||
float CaptionButtonWidth();
|
||||
|
||||
bool Focused();
|
||||
void Focused(bool focused);
|
||||
|
||||
IInspectable Content();
|
||||
void Content(IInspectable content);
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ namespace TerminalApp
|
||||
void ClickButton(CaptionButton button);
|
||||
void ReleaseButtons();
|
||||
Single CaptionButtonWidth { get; };
|
||||
Boolean Focused { get; set; };
|
||||
|
||||
IInspectable Content;
|
||||
Windows.UI.Xaml.Controls.Border DragBar { get; };
|
||||
|
||||
87
src/cascadia/TerminalAzBridge/ConsoleInputReader.cpp
Normal file
87
src/cascadia/TerminalAzBridge/ConsoleInputReader.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "ConsoleInputReader.h"
|
||||
#include "unicode.hpp"
|
||||
|
||||
ConsoleInputReader::ConsoleInputReader(HANDLE handle) :
|
||||
_handle(handle)
|
||||
{
|
||||
_buffer.resize(BufferSize);
|
||||
_convertedString.reserve(BufferSize);
|
||||
}
|
||||
|
||||
void ConsoleInputReader::SetWindowSizeChangedCallback(std::function<void()> callback)
|
||||
{
|
||||
_windowSizeChangedCallback = std::move(callback);
|
||||
}
|
||||
|
||||
std::optional<std::wstring_view> ConsoleInputReader::Read()
|
||||
{
|
||||
DWORD readCount{ 0 };
|
||||
|
||||
_convertedString.clear();
|
||||
while (_convertedString.empty())
|
||||
{
|
||||
_buffer.resize(BufferSize);
|
||||
auto succeeded =
|
||||
ReadConsoleInputW(_handle, _buffer.data(), gsl::narrow_cast<DWORD>(_buffer.size()), &readCount);
|
||||
if (!succeeded)
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
_buffer.resize(readCount);
|
||||
for (auto it = _buffer.begin(); it != _buffer.end(); ++it)
|
||||
{
|
||||
if (it->EventType == WINDOW_BUFFER_SIZE_EVENT && _windowSizeChangedCallback)
|
||||
{
|
||||
_windowSizeChangedCallback();
|
||||
}
|
||||
else if (it->EventType == KEY_EVENT)
|
||||
{
|
||||
const auto& keyEvent = it->Event.KeyEvent;
|
||||
if (keyEvent.bKeyDown || (!keyEvent.bKeyDown && keyEvent.wVirtualKeyCode == VK_MENU))
|
||||
{
|
||||
// Got a high surrogate at the end of the buffer
|
||||
if (IS_HIGH_SURROGATE(keyEvent.uChar.UnicodeChar))
|
||||
{
|
||||
_highSurrogate.emplace(keyEvent.uChar.UnicodeChar);
|
||||
continue; // we've consumed it -- only dispatch it if we get a low
|
||||
}
|
||||
|
||||
if (IS_LOW_SURROGATE(keyEvent.uChar.UnicodeChar))
|
||||
{
|
||||
// No matter what we do, we want to destructively consume the high surrogate
|
||||
if (const auto oldHighSurrogate{ std::exchange(_highSurrogate, std::nullopt) })
|
||||
{
|
||||
_convertedString.push_back(*_highSurrogate);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we get a low without a high surrogate, we've done everything we can.
|
||||
// This is an illegal state.
|
||||
_convertedString.push_back(UNICODE_REPLACEMENT);
|
||||
continue; // onto the next event
|
||||
}
|
||||
}
|
||||
|
||||
// (\0 with a scancode is probably a modifier key, not a VT input key)
|
||||
if (keyEvent.uChar.UnicodeChar != L'\0' || keyEvent.wVirtualScanCode == 0)
|
||||
{
|
||||
if (_highSurrogate) // non-destructive: we don't want to set it to nullopt needlessly for every character
|
||||
{
|
||||
// If we get a high surrogate *here*, we didn't find a low surrogate.
|
||||
// This state is also illegal.
|
||||
_convertedString.push_back(UNICODE_REPLACEMENT);
|
||||
_highSurrogate.reset();
|
||||
}
|
||||
_convertedString.push_back(keyEvent.uChar.UnicodeChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return _convertedString;
|
||||
}
|
||||
33
src/cascadia/TerminalAzBridge/ConsoleInputReader.h
Normal file
33
src/cascadia/TerminalAzBridge/ConsoleInputReader.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Module Name:
|
||||
|
||||
ConsoleInputReader.h
|
||||
|
||||
Abstract:
|
||||
|
||||
This file contains a class whose sole purpose is to
|
||||
abstract away a bunch of details you usually need to
|
||||
know to read VT from a console input handle.
|
||||
|
||||
--*/
|
||||
|
||||
class ConsoleInputReader
|
||||
{
|
||||
public:
|
||||
explicit ConsoleInputReader(HANDLE handle);
|
||||
void SetWindowSizeChangedCallback(std::function<void()> callback);
|
||||
std::optional<std::wstring_view> Read();
|
||||
|
||||
private:
|
||||
static constexpr size_t BufferSize{ 128 };
|
||||
|
||||
HANDLE _handle;
|
||||
std::wstring _convertedString;
|
||||
std::vector<INPUT_RECORD> _buffer;
|
||||
std::optional<wchar_t> _highSurrogate;
|
||||
std::function<void()> _windowSizeChangedCallback;
|
||||
};
|
||||
93
src/cascadia/TerminalAzBridge/TerminalAzBridge.vcxproj
Normal file
93
src/cascadia/TerminalAzBridge/TerminalAzBridge.vcxproj
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{067F0A06-FCB7-472C-96E9-B03B54E8E18D}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>TerminalAzBridge</RootNamespace>
|
||||
<ProjectName>TerminalAzBridge</ProjectName>
|
||||
<TargetName>TerminalAzBridge</TargetName>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<OpenConsoleUniversalApp>false</OpenConsoleUniversalApp>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
|
||||
<VersionInfoFileDescription>Windows Terminal Azure Cloud Shell Connector</VersionInfoFileDescription>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="NuGet Dependencies">
|
||||
<TerminalCppWinrt>true</TerminalCppWinrt>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
||||
<Import Project="$(OpenConsoleDir)src\common.nugetversions.props" />
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<EmbedManifest>true</EmbedManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Source Files -->
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="ConsoleInputReader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="ConsoleInputReader.cpp" />
|
||||
</ItemGroup>
|
||||
<!-- Dependencies -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj">
|
||||
<Project>{CA5CAD1A-C46D-4588-B1C0-40F31AE9100B}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(OpenConsoleDir)src\types\lib\types.vcxproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
This ItemGroup and the Globals PropertyGroup below it are required in order
|
||||
to enable F5 debugging for the unpackaged application
|
||||
-->
|
||||
<ItemGroup>
|
||||
<PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\debugger_general.xml" />
|
||||
<PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\debugger_local_windows.xml" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||
<Import Project="$(OpenConsoleDir)src\common.nugetversions.targets" />
|
||||
|
||||
<!-- These have to come after post.props because the Cpp common targets will inexplicably overwrite them. -->
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<!--
|
||||
BODGY
|
||||
|
||||
The wapproj `GetResolvedWinMD` target tries to get a winmd from every cppwinrt
|
||||
executable we put in the package. But we DON'T produce a winmd. This makes the
|
||||
FastUpToDate check fail every time, and leads to the whole wapproj build
|
||||
running even if you're just f5'ing the package. EVEN AFTER A SUCCESSFUL BUILD.
|
||||
|
||||
Setting GenerateWindowsMetadata=false is enough to tell the build system that
|
||||
we don't produce one, and get it off our backs.
|
||||
-->
|
||||
<ItemDefinitionGroup>
|
||||
<Link>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<Import Project="$(OpenConsoleDir)\build\rules\GenerateSxsManifestsFromWinmds.targets" />
|
||||
</Project>
|
||||
108
src/cascadia/TerminalAzBridge/main.cpp
Normal file
108
src/cascadia/TerminalAzBridge/main.cpp
Normal file
@@ -0,0 +1,108 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
#include "winrt/Microsoft.Terminal.TerminalConnection.h"
|
||||
#include "ConsoleInputReader.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Microsoft::Terminal::TerminalConnection;
|
||||
|
||||
static til::size GetConsoleScreenSize(HANDLE outputHandle)
|
||||
{
|
||||
CONSOLE_SCREEN_BUFFER_INFOEX csbiex{};
|
||||
csbiex.cbSize = sizeof(csbiex);
|
||||
GetConsoleScreenBufferInfoEx(outputHandle, &csbiex);
|
||||
return {
|
||||
(csbiex.srWindow.Right - csbiex.srWindow.Left) + 1,
|
||||
(csbiex.srWindow.Bottom - csbiex.srWindow.Top) + 1
|
||||
};
|
||||
}
|
||||
|
||||
static ConnectionState RunConnectionToCompletion(const ITerminalConnection& connection, HANDLE outputHandle, HANDLE inputHandle)
|
||||
{
|
||||
connection.TerminalOutput([outputHandle](const winrt::hstring& output) {
|
||||
WriteConsoleW(outputHandle, output.data(), output.size(), nullptr, nullptr);
|
||||
});
|
||||
|
||||
// Detach a thread to spin the console read indefinitely.
|
||||
// This application exits when the connection is closed, so
|
||||
// the connection's lifetime will outlast this thread.
|
||||
std::thread([connection, outputHandle, inputHandle] {
|
||||
ConsoleInputReader reader{ inputHandle };
|
||||
reader.SetWindowSizeChangedCallback([&]() {
|
||||
const auto size = GetConsoleScreenSize(outputHandle);
|
||||
|
||||
connection.Resize(size.height, size.width);
|
||||
});
|
||||
|
||||
while (true)
|
||||
{
|
||||
auto input = reader.Read();
|
||||
if (input)
|
||||
{
|
||||
connection.WriteInput(winrt_wstring_to_array_view(*input));
|
||||
}
|
||||
}
|
||||
}).detach();
|
||||
|
||||
std::condition_variable stateChangeVar;
|
||||
std::optional<ConnectionState> state;
|
||||
std::mutex stateMutex;
|
||||
|
||||
connection.StateChanged([&](auto&& /*s*/, auto&& /*e*/) {
|
||||
std::unique_lock<std::mutex> lg{ stateMutex };
|
||||
state = connection.State();
|
||||
stateChangeVar.notify_all();
|
||||
});
|
||||
|
||||
connection.Start();
|
||||
|
||||
std::unique_lock<std::mutex> lg{ stateMutex };
|
||||
stateChangeVar.wait(lg, [&]() {
|
||||
if (!state.has_value())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return state.value() == ConnectionState::Closed || state.value() == ConnectionState::Failed;
|
||||
});
|
||||
|
||||
return state.value();
|
||||
}
|
||||
|
||||
int wmain(int /*argc*/, wchar_t** /*argv*/)
|
||||
{
|
||||
winrt::init_apartment(winrt::apartment_type::single_threaded);
|
||||
|
||||
DWORD inputMode{}, outputMode{};
|
||||
auto conIn{ GetStdHandle(STD_INPUT_HANDLE) }, conOut{ GetStdHandle(STD_OUTPUT_HANDLE) };
|
||||
auto codepage{ GetConsoleCP() }, outputCodepage{ GetConsoleOutputCP() };
|
||||
|
||||
RETURN_IF_WIN32_BOOL_FALSE(GetConsoleMode(conIn, &inputMode));
|
||||
RETURN_IF_WIN32_BOOL_FALSE(GetConsoleMode(conOut, &outputMode));
|
||||
|
||||
RETURN_IF_WIN32_BOOL_FALSE(SetConsoleMode(conIn, ENABLE_WINDOW_INPUT | ENABLE_VIRTUAL_TERMINAL_INPUT));
|
||||
RETURN_IF_WIN32_BOOL_FALSE(SetConsoleMode(conOut, ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_WRAP_AT_EOL_OUTPUT | DISABLE_NEWLINE_AUTO_RETURN));
|
||||
RETURN_IF_WIN32_BOOL_FALSE(SetConsoleCP(CP_UTF8));
|
||||
RETURN_IF_WIN32_BOOL_FALSE(SetConsoleOutputCP(CP_UTF8));
|
||||
|
||||
auto restoreConsoleModes = wil::scope_exit([&]() {
|
||||
SetConsoleMode(conIn, inputMode);
|
||||
SetConsoleMode(conOut, outputMode);
|
||||
SetConsoleCP(codepage);
|
||||
SetConsoleOutputCP(outputCodepage);
|
||||
});
|
||||
|
||||
const auto size = GetConsoleScreenSize(conOut);
|
||||
|
||||
AzureConnection azureConn{};
|
||||
winrt::Windows::Foundation::Collections::ValueSet vs{};
|
||||
vs.Insert(L"initialRows", winrt::Windows::Foundation::PropertyValue::CreateUInt32(gsl::narrow_cast<uint32_t>(size.height)));
|
||||
vs.Insert(L"initialCols", winrt::Windows::Foundation::PropertyValue::CreateUInt32(gsl::narrow_cast<uint32_t>(size.width)));
|
||||
azureConn.Initialize(vs);
|
||||
|
||||
const auto state = RunConnectionToCompletion(azureConn, conOut, conIn);
|
||||
|
||||
return state == ConnectionState::Closed ? 0 : 1;
|
||||
}
|
||||
4
src/cascadia/TerminalAzBridge/pch.cpp
Normal file
4
src/cascadia/TerminalAzBridge/pch.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "pch.h"
|
||||
40
src/cascadia/TerminalAzBridge/pch.h
Normal file
40
src/cascadia/TerminalAzBridge/pch.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*++
|
||||
Copyright (c) Microsoft Corporation
|
||||
Licensed under the MIT license.
|
||||
|
||||
Module Name:
|
||||
- pch.h
|
||||
|
||||
Abstract:
|
||||
- Contains external headers to include in the precompile phase of console build process.
|
||||
- Avoid including internal project headers. Instead include them only in the classes that need them (helps with test project building).
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Ignore checked iterators warning from VC compiler.
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
// Block minwindef.h min/max macros to prevent <algorithm> conflict
|
||||
#define NOMINMAX
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMCX
|
||||
#define NOHELP
|
||||
#define NOCOMM
|
||||
#include <Unknwn.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "../inc/LibraryIncludes.h"
|
||||
|
||||
#include <wil/cppwinrt.h>
|
||||
|
||||
#include <winrt/Windows.system.h>
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Foundation.Collections.h>
|
||||
|
||||
#include <wil/resource.h>
|
||||
#include <wil/win32_helpers.h>
|
||||
|
||||
#include <cppwinrt_utils.h>
|
||||
@@ -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{}));
|
||||
@@ -149,27 +153,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
_renderer->SetBackgroundColorChangedCallback([this]() { _rendererBackgroundColorChanged(); });
|
||||
_renderer->SetFrameColorChangedCallback([this]() { _rendererTabColorChanged(); });
|
||||
_renderer->SetRendererEnteredErrorStateCallback([this]() { _rendererEnteredErrorState(); });
|
||||
_renderer->SetRendererEnteredErrorStateCallback([this]() { RendererEnteredErrorState.raise(nullptr, nullptr); });
|
||||
}
|
||||
|
||||
UpdateSettings(settings, unfocusedAppearance);
|
||||
}
|
||||
|
||||
void ControlCore::_rendererEnteredErrorState()
|
||||
{
|
||||
// The first time the renderer fails out (after all of its own retries), switch it to D2D and WARP
|
||||
// and force it to try again. If it _still_ fails, we can let it halt.
|
||||
if (_renderFailures++ == 0)
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
_renderEngine->SetGraphicsAPI(parseGraphicsAPI(GraphicsAPI::Direct2D));
|
||||
_renderEngine->SetSoftwareRendering(true);
|
||||
_renderer->EnablePainting();
|
||||
return;
|
||||
}
|
||||
RendererEnteredErrorState.raise(nullptr, nullptr);
|
||||
}
|
||||
|
||||
void ControlCore::_setupDispatcherAndCallbacks()
|
||||
{
|
||||
// Get our dispatcher. If we're hosted in-proc with XAML, this will get
|
||||
@@ -280,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.
|
||||
@@ -349,12 +337,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
}
|
||||
}
|
||||
|
||||
void ControlCore::HardResetWithoutErase()
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
_terminal->HardResetWithoutErase();
|
||||
}
|
||||
|
||||
bool ControlCore::Initialize(const float actualWidth,
|
||||
const float actualHeight,
|
||||
const float compositionScale)
|
||||
@@ -420,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
|
||||
@@ -432,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();
|
||||
|
||||
@@ -594,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;
|
||||
@@ -621,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;
|
||||
@@ -779,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.
|
||||
@@ -796,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
|
||||
@@ -901,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))
|
||||
{
|
||||
@@ -927,12 +913,11 @@ 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());
|
||||
_renderFailures = 0; // We may have changed the engine; reset the failure counter.
|
||||
|
||||
// Trigger a redraw to repaint the window background and tab colors.
|
||||
_renderer->TriggerRedrawAll(true, true);
|
||||
@@ -951,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
|
||||
@@ -996,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;
|
||||
@@ -1046,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)
|
||||
{
|
||||
@@ -1059,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);
|
||||
|
||||
@@ -1084,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 };
|
||||
|
||||
@@ -1107,7 +1140,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
|
||||
if (_setFontSizeUnderLock(_settings->FontSize()))
|
||||
if (_setFontSizeUnderLock(_settings.FontSize()))
|
||||
{
|
||||
_refreshSizeUnderLock();
|
||||
}
|
||||
@@ -1664,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
|
||||
@@ -1690,7 +1723,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// - resetOnly: If true, only Reset() will be called, if anything. FindNext() will never be called.
|
||||
// Return Value:
|
||||
// - <none>
|
||||
SearchResults ControlCore::Search(const SearchRequest& request)
|
||||
SearchResults ControlCore::Search(SearchRequest request)
|
||||
{
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
|
||||
@@ -1699,9 +1732,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
WI_SetFlagIf(flags, SearchFlag::RegularExpression, request.RegularExpression);
|
||||
const auto searchInvalidated = _searcher.IsStale(*_terminal.get(), request.Text, flags);
|
||||
|
||||
if (searchInvalidated || request.ExecuteSearch)
|
||||
if (searchInvalidated || !request.ResetOnly)
|
||||
{
|
||||
std::vector<til::point_span> oldResults;
|
||||
til::point_span oldFocused;
|
||||
|
||||
if (const auto focused = _terminal->GetSearchHighlightFocused())
|
||||
{
|
||||
oldFocused = *focused;
|
||||
}
|
||||
|
||||
if (searchInvalidated)
|
||||
{
|
||||
@@ -1710,18 +1749,18 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_terminal->SetSearchHighlights(_searcher.Results());
|
||||
}
|
||||
|
||||
if (request.ExecuteSearch)
|
||||
if (!request.ResetOnly)
|
||||
{
|
||||
_searcher.FindNext(!request.GoForward);
|
||||
}
|
||||
|
||||
_terminal->SetSearchHighlightFocused(gsl::narrow<size_t>(std::max<ptrdiff_t>(0, _searcher.CurrentMatch())));
|
||||
_renderer->TriggerSearchHighlight(oldResults);
|
||||
}
|
||||
|
||||
if (request.ScrollIntoView)
|
||||
{
|
||||
_terminal->ScrollToSearchHighlight(request.ScrollOffset);
|
||||
if (const auto focused = _terminal->GetSearchHighlightFocused(); focused && *focused != oldFocused)
|
||||
{
|
||||
_terminal->ScrollToSearchHighlight(request.ScrollOffset);
|
||||
}
|
||||
}
|
||||
|
||||
int32_t totalMatches = 0;
|
||||
@@ -1928,7 +1967,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
// The lock must be held, because it calls into IRenderData which is shared state.
|
||||
const auto lock = _terminal->LockForWriting();
|
||||
_renderFailures = 0;
|
||||
_renderer->EnablePainting();
|
||||
}
|
||||
|
||||
@@ -2016,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);
|
||||
}
|
||||
@@ -2350,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)
|
||||
@@ -2540,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);
|
||||
@@ -228,7 +228,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
void SetSelectionAnchor(const til::point position);
|
||||
void SetEndSelectionPoint(const til::point position);
|
||||
|
||||
SearchResults Search(const SearchRequest& request);
|
||||
SearchResults Search(SearchRequest request);
|
||||
const std::vector<til::point_span>& SearchResultRows() const noexcept;
|
||||
void ClearSearch();
|
||||
|
||||
@@ -260,7 +260,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
TerminalConnection::ITerminalConnection Connection();
|
||||
void Connection(const TerminalConnection::ITerminalConnection& connection);
|
||||
void HardResetWithoutErase();
|
||||
|
||||
void AnchorContextMenu(til::point viewportRelativeCharacterPosition);
|
||||
|
||||
@@ -269,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
|
||||
@@ -348,7 +347,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
safe_void_coroutine _renderEngineSwapChainChanged(const HANDLE handle);
|
||||
void _rendererBackgroundColorChanged();
|
||||
void _rendererTabColorChanged();
|
||||
void _rendererEnteredErrorState();
|
||||
#pragma endregion
|
||||
|
||||
void _raiseReadOnlyWarning();
|
||||
@@ -403,7 +401,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
float _panelWidth{ 0 };
|
||||
float _panelHeight{ 0 };
|
||||
float _compositionScale{ 0 };
|
||||
uint8_t _renderFailures{ 0 };
|
||||
|
||||
// Audio stuff.
|
||||
MidiAudio _midiAudio;
|
||||
@@ -411,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;
|
||||
@@ -423,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.
|
||||
|
||||
@@ -55,8 +55,7 @@ namespace Microsoft.Terminal.Control
|
||||
Boolean GoForward;
|
||||
Boolean CaseSensitive;
|
||||
Boolean RegularExpression;
|
||||
Boolean ExecuteSearch;
|
||||
Boolean ScrollIntoView;
|
||||
Boolean ResetOnly;
|
||||
Int32 ScrollOffset;
|
||||
};
|
||||
|
||||
@@ -98,7 +97,6 @@ namespace Microsoft.Terminal.Control
|
||||
void ApplyAppearance(Boolean focused);
|
||||
|
||||
Microsoft.Terminal.TerminalConnection.ITerminalConnection Connection;
|
||||
void HardResetWithoutErase();
|
||||
|
||||
IControlSettings Settings { get; };
|
||||
IControlAppearance FocusedAppearance { get; };
|
||||
@@ -106,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; };
|
||||
|
||||
@@ -55,20 +55,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
self->Attached.raise(*self, nullptr);
|
||||
}
|
||||
});
|
||||
|
||||
// GH#14464: Mark mode and quick-edit (shift+arrow) selections update
|
||||
// the selection through ControlCore, bypassing SetEndSelectionPoint.
|
||||
// Listen for selection changes so _selectionNeedsToBeCopied is set
|
||||
// for ALL selection types, not just mouse drag.
|
||||
_core->UpdateSelectionMarkers([weakThis = get_weak()](auto&&, auto&&) {
|
||||
if (auto self{ weakThis.get() })
|
||||
{
|
||||
if (self->_core->HasSelection())
|
||||
{
|
||||
self->_selectionNeedsToBeCopied = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
uint64_t ControlInteractivity::Id()
|
||||
@@ -98,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:
|
||||
@@ -329,18 +315,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
}
|
||||
else
|
||||
{
|
||||
// GH#19942, GH#14464: Don't re-copy a selection that was
|
||||
// already copied via copyOnSelect on mouse-up. But DO copy
|
||||
// if the selection was made via mark mode or modified with
|
||||
// quick-edit keys (shift+arrow), since those paths never
|
||||
// triggered an automatic copy.
|
||||
const auto copied = (_selectionNeedsToBeCopied || !_core->CopyOnSelect()) &&
|
||||
CopySelectionToClipboard(shiftEnabled, false, _core->Settings().CopyFormatting());
|
||||
// Try to copy the text and clear the selection
|
||||
const auto successfulCopy = CopySelectionToClipboard(shiftEnabled, false, _core->Settings().CopyFormatting());
|
||||
_core->ClearSelection();
|
||||
if (_core->CopyOnSelect() || !copied)
|
||||
if (_core->CopyOnSelect() || !successfulCopy)
|
||||
{
|
||||
// CopyOnSelect: right-click always pastes.
|
||||
// Otherwise: no selection → paste.
|
||||
// CopyOnSelect: right click always pastes!
|
||||
// Otherwise: no selection --> paste
|
||||
RequestPasteTextFromClipboard();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Microsoft.Terminal.Control
|
||||
|
||||
UInt64 Id { get; };
|
||||
|
||||
void AttachToNewControl(Microsoft.Terminal.Control.IKeyBindings keyBindings);
|
||||
void AttachToNewControl();
|
||||
void Detach();
|
||||
|
||||
void Close();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -462,11 +462,6 @@ void HwndTerminal::SendOutput(std::wstring_view data)
|
||||
_terminal->Write(data);
|
||||
}
|
||||
|
||||
void _stdcall AvoidBuggyTSFConsoleFlags()
|
||||
{
|
||||
Microsoft::Console::TSF::Handle::AvoidBuggyTSFConsoleFlags();
|
||||
}
|
||||
|
||||
HRESULT _stdcall CreateTerminal(HWND parentHwnd, _Out_ void** hwnd, _Out_ void** terminal)
|
||||
{
|
||||
auto publicTerminal = std::make_unique<HwndTerminal>(parentHwnd);
|
||||
|
||||
@@ -41,7 +41,6 @@ typedef struct _TerminalTheme
|
||||
} TerminalTheme, *LPTerminalTheme;
|
||||
|
||||
extern "C" {
|
||||
__declspec(dllexport) void _stdcall AvoidBuggyTSFConsoleFlags();
|
||||
__declspec(dllexport) HRESULT _stdcall CreateTerminal(HWND parentHwnd, _Out_ void** hwnd, _Out_ void** terminal);
|
||||
__declspec(dllexport) void _stdcall TerminalSendOutput(void* terminal, LPCWSTR data);
|
||||
__declspec(dllexport) void _stdcall TerminalRegisterScrollCallback(void* terminal, void __stdcall callback(int, int, int));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -330,14 +330,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// - bool: whether the current focus is on the search box
|
||||
bool SearchBoxControl::ContainsFocus()
|
||||
{
|
||||
// BODGY: It is possible for this to get called with no XAML root. We are unsure why.
|
||||
if (auto root = XamlRoot())
|
||||
auto focusedElement = Input::FocusManager::GetFocusedElement(this->XamlRoot());
|
||||
if (_focusableElements.count(focusedElement) > 0)
|
||||
{
|
||||
auto focusedElement = Input::FocusManager::GetFocusedElement(root);
|
||||
if (_focusableElements.count(focusedElement) > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -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
|
||||
@@ -536,11 +533,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
_core.Connection(newConnection);
|
||||
}
|
||||
|
||||
void TermControl::HardResetWithoutErase()
|
||||
{
|
||||
_core.HardResetWithoutErase();
|
||||
}
|
||||
|
||||
void TermControl::_throttledUpdateScrollbar(const ScrollBarUpdate& update)
|
||||
{
|
||||
if (!_initializedTerminal)
|
||||
@@ -723,15 +715,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
}
|
||||
else
|
||||
{
|
||||
_handleSearchResults(_core.Search(SearchRequest{
|
||||
.Text = _searchBox->Text(),
|
||||
.GoForward = goForward,
|
||||
.CaseSensitive = _searchBox->CaseSensitive(),
|
||||
.RegularExpression = _searchBox->RegularExpression(),
|
||||
.ExecuteSearch = true,
|
||||
.ScrollIntoView = true,
|
||||
.ScrollOffset = _searchScrollOffset,
|
||||
}));
|
||||
const auto request = SearchRequest{ _searchBox->Text(), goForward, _searchBox->CaseSensitive(), _searchBox->RegularExpression(), false, _searchScrollOffset };
|
||||
_handleSearchResults(_core.Search(request));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,15 +750,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
if (_searchBox && _searchBox->IsOpen())
|
||||
{
|
||||
_handleSearchResults(_core.Search(SearchRequest{
|
||||
.Text = text,
|
||||
.GoForward = goForward,
|
||||
.CaseSensitive = caseSensitive,
|
||||
.RegularExpression = regularExpression,
|
||||
.ExecuteSearch = true,
|
||||
.ScrollIntoView = true,
|
||||
.ScrollOffset = _searchScrollOffset,
|
||||
}));
|
||||
const auto request = SearchRequest{ text, goForward, caseSensitive, regularExpression, false, _searchScrollOffset };
|
||||
_handleSearchResults(_core.Search(request));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -792,15 +770,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
{
|
||||
if (_searchBox && _searchBox->IsOpen())
|
||||
{
|
||||
_handleSearchResults(_core.Search(SearchRequest{
|
||||
.Text = text,
|
||||
.GoForward = goForward,
|
||||
.CaseSensitive = caseSensitive,
|
||||
.RegularExpression = regularExpression,
|
||||
.ExecuteSearch = false,
|
||||
.ScrollIntoView = true,
|
||||
.ScrollOffset = _searchScrollOffset,
|
||||
}));
|
||||
// We only want to update the search results based on the new text. Set
|
||||
// `resetOnly` to true so we don't accidentally update the current match index.
|
||||
const auto request = SearchRequest{ text, goForward, caseSensitive, regularExpression, true, _searchScrollOffset };
|
||||
const auto result = _core.Search(request);
|
||||
_handleSearchResults(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1844,16 +1818,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
return true;
|
||||
}
|
||||
|
||||
// While TSF has an active composition, key events must not be forwarded
|
||||
// to the PTY directly. The IME re-injects navigation/confirmation keys
|
||||
// after composition ends, at which point HasActiveComposition() == false
|
||||
// and they are forwarded normally. This mirrors conhost v1 behavior in
|
||||
// src/interactivity/win32/windowio.cpp.
|
||||
if (GetTSFHandle().HasActiveComposition())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_TrySendKeyEvent(vkey, scanCode, modifiers, keyDown))
|
||||
{
|
||||
return true;
|
||||
@@ -1881,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(),
|
||||
@@ -2028,13 +1991,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
const auto point = args.GetCurrentPoint(*this);
|
||||
const auto type = ptr.PointerDeviceType();
|
||||
|
||||
// GH#19908: _focused can be true even when the search box has
|
||||
// keyboard focus, because GotFocus bubbles from the search box
|
||||
// child and _GotFocusHandler sets _focused=true. If the user
|
||||
// click-drags in the terminal while the search box is focused,
|
||||
// we need to explicitly call Focus() to move keyboard focus back
|
||||
// to the terminal so that Ctrl+C copies the selection.
|
||||
if (!_focused || (_searchBox && _searchBox->ContainsFocus()))
|
||||
if (!_focused)
|
||||
{
|
||||
Focus(FocusState::Pointer);
|
||||
}
|
||||
@@ -2630,9 +2587,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
_updateScrollBar->Run(update);
|
||||
|
||||
// If we have a selection with markers (exposed via selection mode),
|
||||
// update the position of the markers
|
||||
if (_core.HasSelection() && _core.SelectionMode() >= SelectionInteractionMode::Keyboard)
|
||||
// if a selection marker is already visible,
|
||||
// update the position of those markers
|
||||
if (SelectionStartMarker().Visibility() == Visibility::Visible || SelectionEndMarker().Visibility() == Visibility::Visible)
|
||||
{
|
||||
_updateSelectionMarkers(nullptr, winrt::make<UpdateSelectionMarkersEventArgs>(false));
|
||||
}
|
||||
@@ -3198,17 +3155,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
co_return;
|
||||
}
|
||||
|
||||
const auto weak = get_weak();
|
||||
|
||||
if (e.DataView().Contains(StandardDataFormats::ApplicationLink()))
|
||||
{
|
||||
try
|
||||
{
|
||||
auto link{ co_await e.DataView().GetApplicationLinkAsync() };
|
||||
if (const auto strong = weak.get())
|
||||
{
|
||||
_pasteTextWithBroadcast(link.AbsoluteUri());
|
||||
}
|
||||
_pasteTextWithBroadcast(link.AbsoluteUri());
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -3217,10 +3169,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
try
|
||||
{
|
||||
auto link{ co_await e.DataView().GetWebLinkAsync() };
|
||||
if (const auto strong = weak.get())
|
||||
{
|
||||
_pasteTextWithBroadcast(link.AbsoluteUri());
|
||||
}
|
||||
_pasteTextWithBroadcast(link.AbsoluteUri());
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -3229,10 +3178,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
try
|
||||
{
|
||||
auto text{ co_await e.DataView().GetTextAsync() };
|
||||
if (const auto strong = weak.get())
|
||||
{
|
||||
_pasteTextWithBroadcast(text);
|
||||
}
|
||||
_pasteTextWithBroadcast(text);
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -3294,12 +3240,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
}
|
||||
}
|
||||
|
||||
const auto strong = weak.get();
|
||||
if (!strong)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
std::wstring allPathsString;
|
||||
for (auto& fullPath : fullPaths)
|
||||
{
|
||||
@@ -3642,14 +3582,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
safe_void_coroutine TermControl::_updateSelectionMarkers(IInspectable /*sender*/, Control::UpdateSelectionMarkersEventArgs args)
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
||||
auto weakThis{ get_weak() };
|
||||
co_await resume_foreground(Dispatcher());
|
||||
if (const auto strong = weakThis.get())
|
||||
if (weakThis.get() && args)
|
||||
{
|
||||
if (_core.HasSelection() && !args.ClearMarkers())
|
||||
{
|
||||
@@ -3848,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);
|
||||
@@ -3901,15 +3826,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
const auto goForward = _searchBox->GoForward();
|
||||
const auto caseSensitive = _searchBox->CaseSensitive();
|
||||
const auto regularExpression = _searchBox->RegularExpression();
|
||||
_handleSearchResults(_core.Search(SearchRequest{
|
||||
.Text = text,
|
||||
.GoForward = goForward,
|
||||
.CaseSensitive = caseSensitive,
|
||||
.RegularExpression = regularExpression,
|
||||
.ExecuteSearch = false,
|
||||
.ScrollIntoView = false,
|
||||
.ScrollOffset = _searchScrollOffset,
|
||||
}));
|
||||
const auto request = SearchRequest{ text, goForward, caseSensitive, regularExpression, true, _searchScrollOffset };
|
||||
_handleSearchResults(_core.Search(request));
|
||||
}
|
||||
|
||||
void TermControl::_handleSearchResults(SearchResults results)
|
||||
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
@@ -194,11 +192,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
|
||||
TerminalConnection::ITerminalConnection Connection();
|
||||
void Connection(const TerminalConnection::ITerminalConnection& connection);
|
||||
void HardResetWithoutErase();
|
||||
|
||||
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;
|
||||
@@ -250,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;
|
||||
|
||||
@@ -341,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);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user