From 0ec5aef0505ec6502623b17d25c57e6133f1951d Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Thu, 2 May 2024 16:29:33 -0500 Subject: [PATCH 01/24] Squashed commit of the following: commit 727b051fd48c3cf7e91835cd4f6b7c86c563da44 Merge: 37b4b7b6c 7c4dfff45 Author: Mike Griese Date: Thu May 2 16:27:09 2024 -0500 Merge branch 'dev/migrie/f/sui-panes' into dev/migrie/fhl/tasks-pane commit 7c4dfff45154479707ea332515e20b1a5a8c0770 Merge: a0e014f27 67ae9f6c3 Author: Mike Griese Date: Wed Apr 3 11:03:46 2024 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/f/sui-panes commit a0e014f277b8f43eafd62861fb5befd8f0d72271 Merge: e05b2bbe3 2bcbe6b49 Author: Mike Griese Date: Wed Apr 3 10:13:40 2024 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/f/sui-panes commit e05b2bbe3773552a70e3b4bc9f99ac0dc446f996 Merge: ef560bf48 75dea24d6 Author: Mike Griese Date: Fri Mar 29 15:13:01 2024 -0500 Merge branch 'main' into dev/migrie/f/sui-panes commit ef560bf48e5ee4394bf376198010ec98f0382654 Merge: 10e1e4694 7243d220e Author: Mike Griese Date: Tue Mar 26 13:56:21 2024 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit 7243d220e5135b56feba43547b85d7ae0a91cf33 Merge: 1d2059918 501522d69 Author: Mike Griese Date: Tue Mar 26 13:55:54 2024 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/scratchpad-pane commit 10e1e46945c2c2820da7840187cf14c53fccb86d Author: Mike Griese Date: Tue Mar 26 13:55:11 2024 -0500 ALSO doesn't really need to be projected commit ddc88c83b237c44f6a940913b72939bec4232b7f Merge: 216cc3fa6 1d2059918 Author: Mike Griese Date: Tue Mar 26 13:26:16 2024 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit 1d20599186ddd1ea71acbf18c83c6ce74abd1090 Author: Mike Griese Date: Tue Mar 26 11:38:47 2024 -0500 un fix this file commit b6e4b62e15e63bec96121a561088e2be295888a5 Author: Mike Griese Date: Tue Mar 26 11:37:35 2024 -0500 Doesn't really need to be projected commit 0979cd6c44fad0bcd26cb54a0a8122a895a23b2a Merge: d41793470 61e952c58 Author: Mike Griese Date: Tue Mar 26 11:22:45 2024 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit 61e952c58eb5b41d8680ed30a47455b9a822c831 Merge: df73d7554 08dc34612 Author: Mike Griese Date: Tue Mar 26 11:22:27 2024 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 37b4b7b6c06d20806330c01aa12453c57609d232 Author: Mike Griese Date: Fri Mar 22 06:54:29 2024 -0500 fix builds commit 6576f949c4f6f764ced685e145550ae56bc3c2b3 Merge: 66878d2dd 216cc3fa6 Author: Mike Griese Date: Thu Mar 21 14:02:45 2024 -0500 Merge branch 'dev/migrie/f/sui-panes' into dev/migrie/fhl/tasks-pane commit 216cc3fa665845cc1e914401f7a6850c0e600b2a Merge: 77022e92f d41793470 Author: Mike Griese Date: Thu Mar 21 14:02:24 2024 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit d41793470f9dd31b572ad88a274a78132c0743ee Merge: f1ab16e7d df73d7554 Author: Mike Griese Date: Thu Mar 21 13:51:52 2024 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit df73d755414a916fcc73d4d36d52fff4def481fd Author: Mike Griese Date: Thu Mar 21 13:51:34 2024 -0500 derp commit 66878d2ddc9fcf835bdfe79d1f70d72ee7e130c2 Merge: 7b84041ae 77022e92f Author: Mike Griese Date: Thu Mar 21 13:21:51 2024 -0500 Merge branch 'dev/migrie/f/sui-panes' into dev/migrie/fhl/tasks-pane commit 77022e92f14588be4c8f19df5d1ac3bdfa1778af Merge: bcceb8505 f1ab16e7d Author: Mike Griese Date: Thu Mar 21 13:17:20 2024 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit f1ab16e7d59c52bc40a9244dd1f4387c9d82f3d0 Merge: e0bb8409b 2083b2ff9 Author: Mike Griese Date: Thu Mar 21 13:16:08 2024 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit 2083b2ff9e7965d1dd0dfa979011cb7b5651cc97 Merge: 52970ef85 b9a0cae01 Author: Mike Griese Date: Thu Mar 21 13:14:32 2024 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 7b84041ae117578822857740dd9d56471292fef7 Merge: 8f2a129a1 bcceb8505 Author: Mike Griese Date: Wed Mar 20 09:38:28 2024 -0500 Merge branch 'dev/migrie/f/sui-panes' into dev/migrie/fhl/tasks-pane commit bcceb8505768a852f9c8e431fa43c546df31b13f Merge: 352e0a211 e0bb8409b Author: Mike Griese Date: Wed Mar 20 09:20:16 2024 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit 352e0a211a012119a137e39769babb95bc51b982 Author: Mike Griese Date: Wed Mar 20 09:14:28 2024 -0500 fix settings pane for merge (cherry picked from commit 0c6a353967a8a7260e1fffeb137e2593c3046587) commit e0bb8409b32236b699101e6b2e4229ce2db84126 Author: Mike Griese Date: Wed Mar 20 09:13:54 2024 -0500 Fix scratch pane for merge (cherry picked from commit 591080db39c0e7bf77647d7100b302bbe5debad5) commit 8f2a129a1e7fbb98629b579bb76a46986d675ff7 Merge: 5b4747f7b c8d0c0aab Author: Mike Griese Date: Wed Mar 20 06:50:28 2024 -0500 Merge branch 'dev/migrie/f/sui-panes' into dev/migrie/fhl/tasks-pane commit c8d0c0aab78dc3444af10bec8065a6d22a053f94 Merge: 863840ee0 2357653de Author: Mike Griese Date: Wed Mar 20 06:40:43 2024 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit 2357653de5f5ec69fc8b645cfa99efb6541ae8bc Merge: 1951f3043 52970ef85 Author: Mike Griese Date: Wed Mar 20 06:40:04 2024 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit 52970ef8544899c275e0c5abfbfcce518439d647 Author: Mike Griese Date: Tue Mar 19 16:30:00 2024 -0500 RegisterBigTimeEncapsulationViolatingTerminalPaneContentEvents commit 826fc087b03f7aff6cd657651a54335f94e68ee5 Author: Mike Griese Date: Tue Mar 19 15:50:58 2024 -0500 hey there buddy, did you get lost? commit a7533faf459211fa6fba1d632ca745498f66958c Author: Mike Griese Date: Tue Mar 19 15:15:08 2024 -0500 eh these events are from pane content anyways! commit 052dc78af50ea11f4d66651bf0352dc844b05273 Author: Mike Griese Date: Tue Mar 19 14:54:30 2024 -0500 more nits commit fd8b083a4693451523ef8999e51bd6eed7a55e27 Author: Mike Griese Date: Tue Mar 19 13:55:11 2024 -0500 get rid of this file commit 6789ec0765f65635c02eacde9a109ca5be74a404 Author: Mike Griese Date: Tue Mar 19 13:34:35 2024 -0500 some of the easier nits commit 863840ee0f54f1bede2922ba5b90172af200d6b8 Merge: 978fd6e2b 1951f3043 Author: Mike Griese Date: Mon Mar 18 13:20:43 2024 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit 1951f304349f481fdd7c1f589f6596bda56698ce Merge: 35651bc92 524d65869 Author: Mike Griese Date: Mon Mar 18 13:20:26 2024 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit 524d65869972b651836dde479aecce4a272d09ca Author: Mike Griese Date: Fri Mar 15 12:01:42 2024 -0500 GREAT-GREAT-GRANDPARENT: Hey when a pane wants to get closed, we should close it commit ef775a87c987428631414de673b292630fbeb6b9 Merge: a3fbc6438 287422b21 Author: Mike Griese Date: Mon Mar 18 13:19:26 2024 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 5b4747f7b7243e23881ff080b32d82c82d83d262 Merge: 14a00c8ab 978fd6e2b Author: Mike Griese Date: Thu Mar 14 14:10:21 2024 -0500 Merge remote-tracking branch 'origin/dev/migrie/f/sui-panes' into dev/migrie/fhl/tasks-pane commit 978fd6e2ba493dd4ff92d6e0707b3cd69237ed6a Merge: b6254f829 35651bc92 Author: Mike Griese Date: Fri Mar 8 10:36:17 2024 -0600 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit 35651bc92c92a7e5748e81180f312dc089c57489 Merge: 25a885198 a3fbc6438 Author: Mike Griese Date: Fri Mar 8 10:33:31 2024 -0600 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit a3fbc64384494ad392e9697fadcaf6493c3ca52d Merge: de5f7af25 8a1e8ace9 Author: Mike Griese Date: Fri Mar 8 10:33:00 2024 -0600 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit b6254f8294140db2d9f6934e0adc64082b495880 Author: Mike Griese Date: Thu Mar 7 09:49:48 2024 -0600 GREAT-GRANDPARENT: This fixes a crash in parent pane selection (cherry picked from commit 91a0d0e26dc3ca6e595799cec782305e1df839b9) commit 4d47cd58661e51c73b320d56b60f245bd73bd895 Author: Mike Griese Date: Mon Mar 4 16:34:36 2024 -0600 cleanup commit 0a11643f1dfaafdc6ae73d948dfabb336309a83b Author: Mike Griese Date: Mon Mar 4 16:30:16 2024 -0600 sanely pass around a cache instead of... whatever that was. commit 17075d6744e2f40fc3f40e591d8ec8657eae930e Merge: 092b3558f 25a885198 Author: Mike Griese Date: Wed Feb 28 11:50:29 2024 -0600 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit 25a8851986ef311df08b1c761cf0eb15d239e40a Merge: c2446334e de5f7af25 Author: Mike Griese Date: Wed Feb 28 11:36:02 2024 -0600 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit de5f7af25d6b1853e8078b86e75d43b15ec94e16 Merge: 398235818 94e74d22c Author: Mike Griese Date: Wed Feb 28 11:32:40 2024 -0600 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 14a00c8abf3e335de13db82d75e67417971dccd4 Author: Mike Griese Date: Wed Feb 21 12:14:47 2024 -0600 lots of cleanup commit 02a5593f5b0858bda50beafef8f1561fd09868f0 Author: Mike Griese Date: Wed Feb 21 12:07:45 2024 -0600 this is amazing, I'm amazing, everything is awesome commit 29604760194e93ee77497636f59205550fa2abe4 Author: Mike Griese Date: Wed Feb 21 11:39:58 2024 -0600 holy fuck this is better than I imagined a week ago commit 9300647b5843478893e9fcb38062d9d3af6738fd Author: Mike Griese Date: Wed Feb 21 11:20:33 2024 -0600 turns out Visibility works exactly like you'd want for a TreeView commit b706a6d679b2b86466c00496427bad8431b5231e Author: Mike Griese Date: Wed Feb 21 11:01:36 2024 -0600 yes yes subclasses are hard in C commit 17d70f522173039f3a816394b95deee03ead0f43 Author: Mike Griese Date: Wed Feb 21 10:57:05 2024 -0600 weird but works surprisingly well commit 69cb54509ca5a0d3af3bd92389e05f7be98417fd Author: Mike Griese Date: Wed Feb 21 10:16:41 2024 -0600 Blindly, what if TaskViewModel was a FilteredCommand? commit def66306a18b9455db45f60725ef191a45742ec6 Author: Mike Griese Date: Wed Feb 21 09:32:50 2024 -0600 I wanted to start adding a filter box, but that got tricky commit d86bd5787678b3422930eeb43844f497508ad774 Merge: 01ca03f43 afa7a2478 Author: Mike Griese Date: Wed Feb 21 09:18:46 2024 -0600 Merge branch 'dev/migrie/fhl/tasks-pane' of https://github.com/microsoft/terminal into dev/migrie/fhl/tasks-pane commit 01ca03f433c3199abbbb4b98cd71dd65fbf6d562 Author: Mike Griese Date: Wed Feb 21 09:17:44 2024 -0600 Don't generate names with visualized SPC and BS for the sxnui You know, this doesn't really help right now, but it should fix #16577, and maybe help with #16578 (but not the command palette part) commit c94c00b76001af4e9bc92660b8f86bef0ea6a127 Author: Mike Griese Date: Tue Feb 20 16:12:12 2024 -0600 more better styling commit afa7a2478b37e6166adde6bcab4f991c59a81dc3 Author: Mike Griese Date: Tue Feb 20 16:12:12 2024 -0600 more better styling commit db427f2cd1dd6514340b4dd4058e8b2180572ccb Author: Mike Griese Date: Tue Feb 20 16:11:34 2024 -0600 better styling commit 2f3ecf1ea0a539451954961194a1a0eeed3c62fd Author: Mike Griese Date: Tue Feb 20 15:41:10 2024 -0600 plumb the action through to the task pane commit d7a6b1899c23a123eb59bb16a217e8dbd95bfe5a Author: Mike Griese Date: Tue Feb 20 09:28:42 2024 -0600 re-add the visibility hack; add a play button that does nothing commit 365c068da1f4a9f24c93dbf2446e837e5a1a9290 Author: Mike Griese Date: Mon Feb 19 12:42:24 2024 -0600 this fixes that random item reuse problem commit 8418d6a1cbc2a90a4c16c0cd8c5db15eb0f55757 Author: Mike Griese Date: Fri Feb 16 15:54:21 2024 -0600 omg bind to the IsSelected commit 0bb13f9eeede6799909480a47965d9849a42aff7 Author: Mike Griese Date: Fri Feb 16 09:23:50 2024 -0600 real xaml commit e72b1bf835769c5d158bd2277601d402de5499f0 Author: Mike Griese Date: Fri Feb 16 08:40:29 2024 -0600 nested commands are easy guys commit 81b35ff143a9d460aa1457c3bf4ad9ca9a081ad5 Author: Mike Griese Date: Fri Feb 16 08:32:30 2024 -0600 this worked surprisingly quickly commit 092b3558f356ef964e882b5e5c934c35c004d096 Merge: 389ba20a9 c2446334e Author: Mike Griese Date: Thu Feb 8 09:47:33 2024 -0600 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit c2446334e6bfd97dbbae82a588068d492ce4e8c6 Merge: 7bc1457d4 398235818 Author: Mike Griese Date: Thu Feb 8 09:46:46 2024 -0600 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit 39823581886720cf84ece29ec074e6e8c68d854a Merge: 0d528f84f 71c35cf24 Author: Mike Griese Date: Thu Feb 8 09:40:19 2024 -0600 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 0d528f84f28a7d3dbe8d34d55e3b3b40349d3438 Merge: 6bc711de0 92f9ff948 Author: Mike Griese Date: Fri Jan 19 16:25:31 2024 -0600 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 6bc711de065466221738610fb5b9cba40ae1cf60 Author: Mike Griese Date: Wed Nov 8 11:10:58 2023 -0600 maybe I'm not that good at coding commit f622d80004768a5e49ba324fe6d92b7f15a0f3ab Merge: 4cec7e9b4 077d63e6a Author: Mike Griese Date: Wed Nov 8 05:55:27 2023 -0600 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 4cec7e9b4b6063a910e2db573f81402fe736ed8e Author: Mike Griese Date: Mon Nov 6 06:01:55 2023 -0600 try to remove a few of these but ultimately, eh commit cf920e7d58d93e0fd5ace7d737c7afaa31b2cc77 Merge: 58e8f3c11 0289cb043 Author: Mike Griese Date: Thu Nov 2 06:13:22 2023 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 389ba20a9867239191a7162a6f813aa871baf602 Author: Mike Griese Date: Wed Oct 25 14:41:57 2023 -0500 spel commit dd8606ff9b902673f7df5971ffefaa64a8f2752f Merge: fb74fc8c6 7bc1457d4 Author: Mike Griese Date: Wed Oct 25 11:04:43 2023 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit 7bc1457d4247c559110fcebd35c116f27bc50975 Author: Mike Griese Date: Wed Oct 25 11:03:41 2023 -0500 nits and such commit e9e04d4e70b92f00a2c5e41900ec7cf211e83608 Merge: b49997b4b 58e8f3c11 Author: Mike Griese Date: Wed Oct 25 09:37:37 2023 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit 58e8f3c11ccdeb3194b58ad29ad5f738a4c6c684 Author: Mike Griese Date: Wed Oct 25 09:37:23 2023 -0500 mostly nits commit 8df9523a7783a0cfff3538e61edf3dae41fa32a4 Merge: fd0640997 d0d303996 Author: Mike Griese Date: Wed Oct 25 09:04:35 2023 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit fd0640997d5d746942563eb2f74a8259969f9c98 Author: Mike Griese Date: Fri Oct 13 15:17:38 2023 -0500 annoying build break commit fb74fc8c6a5f1377f4f8b95618a667cbd0742d29 Author: Mike Griese Date: Fri Oct 13 14:58:19 2023 -0500 dead code commit 5f4087ff00365e0f53f83a1e36203e78d2009231 Author: Mike Griese Date: Fri Oct 13 14:56:50 2023 -0500 finish exorcising SettingsTab commit 81889a685ca115d2c2763a02edec1ab131c230c6 Author: Mike Griese Date: Fri Oct 13 14:08:49 2023 -0500 derp commit e82c627ebea96bb0ed6e29fcdefba6e973f9b193 Author: Mike Griese Date: Fri Oct 13 12:09:08 2023 -0500 dead code removal commit d726165330e092dcd55147fce3528185d831e9fa Author: Mike Griese Date: Fri Oct 13 12:06:59 2023 -0500 terrible, but it works commit 57e1f26d14bb0f868e17b37dcb3da69fb1a890ad Merge: 6107c3e55 b49997b4b Author: Mike Griese Date: Fri Oct 13 11:36:27 2023 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit b49997b4b413fa83d61d4d1ed363c1c0479d44de Merge: 46469aa5e 2086e0f3a Author: Mike Griese Date: Fri Oct 13 11:12:24 2023 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit 2086e0f3af1d2199e18fde18dafc83ff0910f877 Merge: c869b47e1 544cdd78a Author: Mike Griese Date: Fri Oct 13 10:39:02 2023 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 6107c3e551fc62ada422ffbbf9c66d666bae145c Merge: 953106953 46469aa5e Author: Mike Griese Date: Mon Sep 11 05:43:06 2023 -0500 Merge branch 'dev/migrie/fhl/scratchpad-pane' into dev/migrie/f/sui-panes commit 46469aa5e305f23424fe8ae59f7485e6adbb3f77 Merge: 1cc983545 c869b47e1 Author: Mike Griese Date: Mon Sep 11 05:24:30 2023 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit c869b47e13257ec3b12295884dd2c69f9ca3e711 Merge: e0b003ad4 4ddfc3eaf Author: Mike Griese Date: Mon Sep 11 05:22:43 2023 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit 95310695381a4b08d8656094481b7b3848249208 Author: Mike Griese Date: Mon Aug 7 15:17:09 2023 -0500 background brush, done commit 521e3015415a74c6dc70a079b9a5242b79d19f44 Author: Mike Griese Date: Thu Aug 3 13:50:11 2023 -0500 update settings should work now commit 842326daa5b5dcde126197e49f39489c64a70e11 Author: Mike Griese Date: Thu Aug 3 11:31:57 2023 -0500 icons for non-terminal pane content commit fb7c80938bd5662599efa01679b30ee55ffee835 Author: Mike Griese Date: Tue Aug 1 11:37:10 2023 -0500 derp commit 29d0d576566c68b21b77541e523acbf1ddb2ecbe Author: Mike Griese Date: Thu Jul 27 16:29:26 2023 -0500 this works better than it has any right to commit cbd61b0a7d687e9812dce274324f5c26b5ddb2a1 Author: Mike Griese Date: Thu Jul 27 15:55:05 2023 -0500 POC: yea, this works commit 1cc9835454acbeef1b82a11ea7aea97b4d6e34c0 Author: Mike Griese Date: Thu Jul 27 13:58:44 2023 -0500 feature flags too commit 86914bdfc16c1db3d7258c621d37db10845a981b Merge: a23c1a24d e0b003ad4 Author: Mike Griese Date: Tue Jul 25 13:28:25 2023 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit e0b003ad4d50327e7f3c912e7151f44777de0179 Merge: f89368c19 5daf4983d Author: Mike Griese Date: Mon Jul 24 14:10:40 2023 -0500 Merge branch 'main' into dev/migrie/fhl/non-terminal-panes-2023 commit f89368c19bf9d129faff31ea343078d43710208f Author: Mike Griese Date: Tue Jul 18 13:47:38 2023 -0500 [PARENT] try to use GetActiveTerminalControl less in TerminalTab (cherry picked from commit 262d95aae5b1caa2957b113b7fece2d8802a0c56) commit 5582e1bcc87411f404701749d221e66702122dac Author: Mike Griese Date: Tue Jul 18 13:21:18 2023 -0500 [PARENT] You know what, I just went for it. (cherry picked from commit 63ba8e19fd4d43176e25668c50bdd6886612324e) commit a23c1a24dc95556340dd97e7e99c8d857111f53e Author: Mike Griese Date: Thu Jul 20 07:39:02 2023 -0500 keybindings too commit 5f9add4000f402427a1efa15a26dd1f9ab040f5e Merge: 2d4030683 11126f9b3 Author: Mike Griese Date: Thu Jul 20 07:04:10 2023 -0500 Merge branch 'dev/migrie/fhl/non-terminal-panes-2023' into dev/migrie/fhl/scratchpad-pane commit 11126f9b37ef4cc4404c0ad041016a2dbe59a152 Merge: e31202b0b 701062649 Author: Mike Griese Date: Thu Jul 20 07:02:16 2023 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit e31202b0b82c0ad53c9e2fc4b65ff6c6c3efb761 Merge: e6dc314c1 6a10ea5a7 Author: Mike Griese Date: Thu Jul 20 07:02:04 2023 -0500 Merge commit '6a10ea5' into dev/migrie/fhl/non-terminal-panes-2023 commit e6dc314c1799d2dbbc7489d4191ea31b6fbd47f9 Merge: 049c04327 b4042eaaf Author: Mike Griese Date: Wed Jul 19 16:22:03 2023 -0500 Merge commit 'b4042ea' into dev/migrie/fhl/non-terminal-panes-2023 commit 2d4030683a494c214c434513c194c2caed22fe3c Author: Mike Griese Date: Tue Jul 18 13:47:58 2023 -0500 Let's just make it experimental commit 262d95aae5b1caa2957b113b7fece2d8802a0c56 Author: Mike Griese Date: Tue Jul 18 13:47:38 2023 -0500 [PARENT] try to use GetActiveTerminalControl less in TerminalTab commit 63ba8e19fd4d43176e25668c50bdd6886612324e Author: Mike Griese Date: Tue Jul 18 13:21:18 2023 -0500 [PARENT] You know what, I just went for it. commit 1b39db7ab0dd40d3889fd00ba47a51a87755c75a Author: Mike Griese Date: Tue Jul 18 12:58:55 2023 -0500 Single commit that adds the whole scratchpad and action commit 2dd8f409b23d38bac65ed08311f0ed8da57e01a3 Author: Mike Griese Date: Tue Jul 18 11:48:33 2023 -0500 [TO PARENT] dead code commit 049c043279e6de5d32a38af363f84dbd3fdfc978 Author: Mike Griese Date: Tue Jul 18 10:26:32 2023 -0500 some last cleanups commit a1da6c117eaa651ae8190f8a54adcea9b778dd28 Author: Mike Griese Date: Tue Jul 18 10:13:44 2023 -0500 huge shuffling so that pane content can raise events instead of relying on termcontrol commit 7c9ffb0e02e5323251769983805d57b754e6d192 Author: Mike Griese Date: Tue Jul 18 06:06:07 2023 -0500 snapping now uses an interface, so that it's not TermControl-specific commit 84df8197d481d2e193ab89fb20d53d35e3cd561a Author: Mike Griese Date: Mon Jul 17 14:22:12 2023 -0500 close event commit 5b3aa54b560ba2ac30005f568def90baa0de2d5e Author: Mike Griese Date: Mon Jul 17 12:42:43 2023 -0500 move GetNewTerminalArgs into IPaneContent commit ef6bb8a73ca25fb6593cd8ff0e6bcabe006f7b5e Author: Mike Griese Date: Mon Jul 17 12:35:27 2023 -0500 hey look, it builds now commit 4e144425f0854cef3e8f78baf50b8c6b83d53e3b Merge: f353323a2 f4bcbfbad Author: Mike Griese Date: Mon Jul 17 10:53:56 2023 -0500 Merge remote-tracking branch 'origin/main' into dev/migrie/fhl/non-terminal-panes-2023 commit f353323a233d0547c06a1800fb74c5e8f9ba58a5 Author: Mike Griese Date: Fri May 12 13:32:12 2023 -0500 I wanted to do this in one shot but _zelda_ --- .../TerminalApp/AppActionHandlers.cpp | 22 +++ src/cascadia/TerminalApp/FilteredCommand.cpp | 19 ++- src/cascadia/TerminalApp/FilteredCommand.h | 5 +- src/cascadia/TerminalApp/FilteredCommand.idl | 2 +- src/cascadia/TerminalApp/TabManagement.cpp | 10 ++ src/cascadia/TerminalApp/TasksPaneContent.cpp | 125 +++++++++++++++ src/cascadia/TerminalApp/TasksPaneContent.h | 140 +++++++++++++++++ .../TerminalApp/TasksPaneContent.xaml | 143 ++++++++++++++++++ .../TerminalApp/TerminalAppLib.vcxproj | 14 +- src/cascadia/TerminalApp/TerminalPage.cpp | 4 +- .../TerminalApp/TerminalPaneContent.idl | 17 +++ src/cascadia/TerminalApp/TerminalTab.cpp | 12 ++ .../TerminalSettingsModel/ActionAndArgs.cpp | 2 + .../TerminalSettingsModel/ActionMap.cpp | 14 +- .../AllShortcutActions.h | 3 +- .../Resources/en-US/Resources.resw | 6 +- .../TerminalSettingsModel/defaults.json | 1 + src/cascadia/inc/cppwinrt_utils.h | 4 +- src/inc/til/string.h | 20 +++ 19 files changed, 548 insertions(+), 15 deletions(-) create mode 100644 src/cascadia/TerminalApp/TasksPaneContent.cpp create mode 100644 src/cascadia/TerminalApp/TasksPaneContent.h create mode 100644 src/cascadia/TerminalApp/TasksPaneContent.xaml diff --git a/src/cascadia/TerminalApp/AppActionHandlers.cpp b/src/cascadia/TerminalApp/AppActionHandlers.cpp index d044cbe13f2..fbe27ea6525 100644 --- a/src/cascadia/TerminalApp/AppActionHandlers.cpp +++ b/src/cascadia/TerminalApp/AppActionHandlers.cpp @@ -6,6 +6,7 @@ #include "TerminalPage.h" #include "ScratchpadContent.h" +#include "TasksPaneContent.h" #include "../WinRTUtils/inc/WtExeUtils.h" #include "../../types/inc/utils.hpp" #include "Utils.h" @@ -1473,4 +1474,25 @@ namespace winrt::TerminalApp::implementation _ShowAboutDialog(); args.Handled(true); } + + void TerminalPage::_HandleOpenTasksPane(const IInspectable& sender, + const ActionEventArgs& args) + { + if (Feature_ScratchpadPane::IsEnabled()) + { + const auto& scratchPane{ winrt::make_self() }; + scratchPane->UpdateSettings(_settings); + // This is maybe a little wacky - add our key event handler to the pane + // we made. So that we can get actions for keys that the content didn't + // handle. + scratchPane->GetRoot().KeyDown({ this, &TerminalPage::_KeyDownHandler }); + + scratchPane->DispatchCommandRequested({ this, &TerminalPage::_OnDispatchCommandRequested }); + + const auto resultPane = std::make_shared(*scratchPane); + _SplitPane(_senderOrFocusedTab(sender), SplitDirection::Automatic, 0.5f, resultPane); + args.Handled(true); + } + } + } diff --git a/src/cascadia/TerminalApp/FilteredCommand.cpp b/src/cascadia/TerminalApp/FilteredCommand.cpp index 98a7b53de4b..d6c6c38a284 100644 --- a/src/cascadia/TerminalApp/FilteredCommand.cpp +++ b/src/cascadia/TerminalApp/FilteredCommand.cpp @@ -21,11 +21,22 @@ namespace winrt::TerminalApp::implementation { // This class is a wrapper of PaletteItem, that is used as an item of a filterable list in CommandPalette. // It manages a highlighted text that is computed by matching search filter characters to item name - FilteredCommand::FilteredCommand(const winrt::TerminalApp::PaletteItem& item) : - _Item(item), - _Filter(L""), - _Weight(0) + FilteredCommand::FilteredCommand(const winrt::TerminalApp::PaletteItem& item) { + // Actually implement the ctor in _constructFilteredCommand + _constructFilteredCommand(item); + } + + // We need to actually implement the ctor in a separate helper. This is + // because we have a FilteredTask class which derives from FilteredCommand. + // HOWEVER, for cppwinrt ~ r e a s o n s ~, it doesn't actually derive from + // FilteredCommand directly, so we can't just use the FilteredCommand ctor + // directly in the base class. + void FilteredCommand::_constructFilteredCommand(const winrt::TerminalApp::PaletteItem& item) + { + _Item = item; + _Filter = L""; + _Weight = 0; _HighlightedName = _computeHighlightedName(); // Recompute the highlighted name if the item name changes diff --git a/src/cascadia/TerminalApp/FilteredCommand.h b/src/cascadia/TerminalApp/FilteredCommand.h index e5df7bb018a..f304ad032a3 100644 --- a/src/cascadia/TerminalApp/FilteredCommand.h +++ b/src/cascadia/TerminalApp/FilteredCommand.h @@ -19,7 +19,7 @@ namespace winrt::TerminalApp::implementation FilteredCommand() = default; FilteredCommand(const winrt::TerminalApp::PaletteItem& item); - void UpdateFilter(const winrt::hstring& filter); + virtual void UpdateFilter(const winrt::hstring& filter); static int Compare(const winrt::TerminalApp::FilteredCommand& first, const winrt::TerminalApp::FilteredCommand& second); @@ -29,6 +29,9 @@ namespace winrt::TerminalApp::implementation WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::HighlightedText, HighlightedName, PropertyChanged.raise); WINRT_OBSERVABLE_PROPERTY(int, Weight, PropertyChanged.raise); + protected: + void _constructFilteredCommand(const winrt::TerminalApp::PaletteItem& item); + private: winrt::TerminalApp::HighlightedText _computeHighlightedName(); int _computeWeight(); diff --git a/src/cascadia/TerminalApp/FilteredCommand.idl b/src/cascadia/TerminalApp/FilteredCommand.idl index ce2b04b92c1..a63e6e81100 100644 --- a/src/cascadia/TerminalApp/FilteredCommand.idl +++ b/src/cascadia/TerminalApp/FilteredCommand.idl @@ -6,7 +6,7 @@ import "HighlightedTextControl.idl"; namespace TerminalApp { - [default_interface] runtimeclass FilteredCommand : Windows.UI.Xaml.Data.INotifyPropertyChanged + [default_interface] unsealed runtimeclass FilteredCommand : Windows.UI.Xaml.Data.INotifyPropertyChanged { FilteredCommand(); FilteredCommand(PaletteItem item); diff --git a/src/cascadia/TerminalApp/TabManagement.cpp b/src/cascadia/TerminalApp/TabManagement.cpp index 3053d746df2..ac635bb2fd2 100644 --- a/src/cascadia/TerminalApp/TabManagement.cpp +++ b/src/cascadia/TerminalApp/TabManagement.cpp @@ -137,6 +137,16 @@ namespace winrt::TerminalApp::implementation // for it. The Title change will be propagated upwards through the tab's // PropertyChanged event handler. newTabImpl->ActivePaneChanged([weakTab, weakThis{ get_weak() }]() { + // TODO! + // + // * Make this a method on TerminalPage. + // * Convert ActivePaneChanged to a typed event, so it sends the sender (so we don't need to make all these lambdas) + // * Stash the task pane as a member on the Terminal? if one was opened. + // * If the tab does have a taskpane, then tell the taskpane the active pane changed + // + // wait don't do any of that. just do that in TerminalTab directly + // before we even raise the event you donkey + auto page{ weakThis.get() }; auto tab{ weakTab.get() }; diff --git a/src/cascadia/TerminalApp/TasksPaneContent.cpp b/src/cascadia/TerminalApp/TasksPaneContent.cpp new file mode 100644 index 00000000000..1f941a17ad1 --- /dev/null +++ b/src/cascadia/TerminalApp/TasksPaneContent.cpp @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +#include "pch.h" +#include "TasksPaneContent.h" +#include "TasksPaneContent.g.cpp" +#include "FilteredTask.g.cpp" + +using namespace winrt::Windows::Foundation; +using namespace winrt::Microsoft::Terminal::Settings; +using namespace winrt::Microsoft::Terminal::Settings::Model; + +namespace winrt +{ + namespace WUX = Windows::UI::Xaml; + namespace MUX = Microsoft::UI::Xaml; + using IInspectable = Windows::Foundation::IInspectable; +} + +namespace winrt::TerminalApp::implementation +{ + TasksPaneContent::TasksPaneContent() + { + InitializeComponent(); + + auto res = Windows::UI::Xaml::Application::Current().Resources(); + auto bg = res.Lookup(winrt::box_value(L"UnfocusedBorderBrush")); + Background(bg.try_as()); + } + + void TasksPaneContent::_updateFilteredCommands() + { + const auto& queryString = _filterBox().Text(); + + // DON'T replace the itemSource here. If you do, it'll un-expand all the + // nested items the user has expanded. Instead, just update the filter. + // That'll also trigger a PropertyChanged for the Visibility property. + for (const auto& t : _allTasks) + { + t.UpdateFilter(queryString); + } + } + + void TasksPaneContent::UpdateSettings(const CascadiaSettings& settings) + { + _settings = settings; + + // 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 sxnui to _also_ filter with that + // string. + + const auto tasks = _settings.GlobalSettings().ActionMap().FilterToSendInput(L""); // IVector + _allTasks = winrt::single_threaded_observable_vector(); + for (const auto& t : tasks) + { + const auto& filtered{ winrt::make(t) }; + _allTasks.Append(filtered); + } + _treeView().ItemsSource(_allTasks); + + _updateFilteredCommands(); + } + + void TasksPaneContent::_filterTextChanged(const IInspectable& /*sender*/, + const Windows::UI::Xaml::RoutedEventArgs& /*args*/) + { + _updateFilteredCommands(); + } + + winrt::Windows::UI::Xaml::FrameworkElement TasksPaneContent::GetRoot() + { + return *this; + } + winrt::Windows::Foundation::Size TasksPaneContent::MinimumSize() + { + return { 1, 1 }; + } + void TasksPaneContent::Focus(winrt::Windows::UI::Xaml::FocusState reason) + { + reason; + // _box.Focus(reason); + } + void TasksPaneContent::Close() + { + CloseRequested.raise(*this, nullptr); + } + + NewTerminalArgs TasksPaneContent::GetNewTerminalArgs(const bool /* asContent */) const + { + return nullptr; + } + + winrt::hstring TasksPaneContent::Icon() const + { + static constexpr std::wstring_view glyph{ L"\xe70b" }; // QuickNote + return winrt::hstring{ glyph }; + } + + winrt::Windows::UI::Xaml::Media::Brush TasksPaneContent::BackgroundBrush() + { + return Background(); + } + + void TasksPaneContent::SetLastActiveControl(const Microsoft::Terminal::Control::TermControl& control) + { + _control = control; + } + + void TasksPaneContent::_runCommandButtonClicked(const Windows::Foundation::IInspectable& sender, + const Windows::UI::Xaml::RoutedEventArgs&) + { + if (const auto& taskVM{ sender.try_as().DataContext().try_as() }) + { + if (const auto& strongControl{ _control.get() }) + { + // By using the last active control as the sender here, the + // actiopn dispatch will send this to the active control, + // thinking that it is the control that requested this event. + DispatchCommandRequested.raise(strongControl, taskVM->Command()); + } + } + } + +} diff --git a/src/cascadia/TerminalApp/TasksPaneContent.h b/src/cascadia/TerminalApp/TasksPaneContent.h new file mode 100644 index 00000000000..935b18a70b3 --- /dev/null +++ b/src/cascadia/TerminalApp/TasksPaneContent.h @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +#pragma once +#include "TasksPaneContent.g.h" +#include "FilteredTask.g.h" +#include "FilteredCommand.h" +#include "ActionPaletteItem.h" + +namespace winrt::TerminalApp::implementation +{ + struct TasksPaneContent : TasksPaneContentT + { + TasksPaneContent(); + + winrt::Windows::UI::Xaml::FrameworkElement GetRoot(); + + void UpdateSettings(const winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings& settings); + + winrt::Windows::Foundation::Size MinimumSize(); + void Focus(winrt::Windows::UI::Xaml::FocusState reason = winrt::Windows::UI::Xaml::FocusState::Programmatic); + void Close(); + winrt::Microsoft::Terminal::Settings::Model::NewTerminalArgs GetNewTerminalArgs(const bool asContent) const; + + // TODO! lots of strings here and in XAML that need RS_-ifying + winrt::hstring Title() { return L"Tasks"; } + uint64_t TaskbarState() { return 0; } + uint64_t TaskbarProgress() { return 0; } + bool ReadOnly() { return false; } + winrt::hstring Icon() const; + Windows::Foundation::IReference TabColor() const noexcept { return nullptr; } + winrt::Windows::UI::Xaml::Media::Brush BackgroundBrush(); + + void SetLastActiveControl(const Microsoft::Terminal::Control::TermControl& control); + + til::typed_event<> CloseRequested; + til::typed_event BellRequested; + til::typed_event<> TitleChanged; + til::typed_event<> TabColorChanged; + til::typed_event<> TaskbarProgressChanged; + til::typed_event<> ConnectionStateChanged; + til::typed_event<> ReadOnlyChanged; + til::typed_event<> FocusRequested; + + til::typed_event DispatchCommandRequested; + + private: + friend struct TasksPaneContentT; // for Xaml to bind events + + winrt::weak_ref _control{ nullptr }; + winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr }; + + winrt::Windows::Foundation::Collections::IObservableVector _allTasks{ nullptr }; + + void _runCommandButtonClicked(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs&); + void _filterTextChanged(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& args); + + void _updateFilteredCommands(); + }; + + struct FilteredTask : FilteredTaskT + { + FilteredTask() = default; + + FilteredTask(const winrt::Microsoft::Terminal::Settings::Model::Command& command) + { + _constructFilteredCommand(winrt::make(command)); + _command = command; + + // The Children() method must always return a non-null vector + _children = winrt::single_threaded_observable_vector(); + if (_command.HasNestedCommands()) + { + for (const auto& [_, child] : _command.NestedCommands()) + { + auto vm{ winrt::make(child) }; + _children.Append(vm); + } + } + } + + void UpdateFilter(const winrt::hstring& filter) override + { + TerminalApp::implementation::FilteredCommand::UpdateFilter(filter); + for (const auto& c : _children) + { + c.UpdateFilter(filter); + } + + PropertyChanged.raise(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs{ L"Visibility" }); + } + + winrt::hstring Input() + { + if (const auto& actionItem{ _Item.try_as() }) + { + if (const auto& command{ actionItem.Command() }) + { + if (const auto& sendInput{ command.ActionAndArgs().Args().try_as() }) + { + return sendInput.Input(); + } + } + } + return L""; + }; + + winrt::Windows::Foundation::Collections::IObservableVector Children() { return _children; } + winrt::Microsoft::Terminal::Settings::Model::Command Command() { return _command; } + + // Used to control if this item is visible in the TreeView. Turns out, + // TreeView is in fact sane enough to remove items entirely if they're + // Collapsed. + winrt::Windows::UI::Xaml::Visibility Visibility() + { + // Is there no filter, or do we match it? + if (_Filter.empty() || _Weight > 0) + { + return winrt::Windows::UI::Xaml::Visibility::Visible; + } + // If we don't match, maybe one of our children does + auto totalWeight = _Weight; + for (const auto& c : _children) + { + totalWeight += c.Weight(); + } + + return totalWeight > 0 ? winrt::Windows::UI::Xaml::Visibility::Visible : winrt::Windows::UI::Xaml::Visibility::Collapsed; + }; + + private: + winrt::Microsoft::Terminal::Settings::Model::Command _command{ nullptr }; + winrt::Windows::Foundation::Collections::IObservableVector _children{ nullptr }; + }; +} + +namespace winrt::TerminalApp::factory_implementation +{ + BASIC_FACTORY(TasksPaneContent); +} diff --git a/src/cascadia/TerminalApp/TasksPaneContent.xaml b/src/cascadia/TerminalApp/TasksPaneContent.xaml new file mode 100644 index 00000000000..c13830b9416 --- /dev/null +++ b/src/cascadia/TerminalApp/TasksPaneContent.xaml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cascadia/TerminalApp/TerminalAppLib.vcxproj b/src/cascadia/TerminalApp/TerminalAppLib.vcxproj index d0629da8036..f6a669624a6 100644 --- a/src/cascadia/TerminalApp/TerminalAppLib.vcxproj +++ b/src/cascadia/TerminalApp/TerminalAppLib.vcxproj @@ -71,6 +71,9 @@ Designer + + Designer + @@ -161,6 +164,9 @@ TerminalPaneContent.idl + + TasksPaneContent.xaml + TerminalPaneContent.idl @@ -274,6 +280,9 @@ TerminalPaneContent.idl + + TasksPaneContent.xaml + TerminalPaneContent.idl @@ -352,7 +361,10 @@ - + + TaskPaneContent.xaml + Code + diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index 3a82a05aebf..70af18b7434 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -454,10 +454,10 @@ namespace winrt::TerminalApp::implementation // - command - command to dispatch // Return Value: // - - void TerminalPage::_OnDispatchCommandRequested(const IInspectable& /*sender*/, const Microsoft::Terminal::Settings::Model::Command& command) + void TerminalPage::_OnDispatchCommandRequested(const IInspectable& sender, const Microsoft::Terminal::Settings::Model::Command& command) { const auto& actionAndArgs = command.ActionAndArgs(); - _actionDispatch->DoAction(actionAndArgs); + _actionDispatch->DoAction(sender, actionAndArgs); } // Method Description: diff --git a/src/cascadia/TerminalApp/TerminalPaneContent.idl b/src/cascadia/TerminalApp/TerminalPaneContent.idl index 0e4738fff42..98347e60e14 100644 --- a/src/cascadia/TerminalApp/TerminalPaneContent.idl +++ b/src/cascadia/TerminalApp/TerminalPaneContent.idl @@ -3,6 +3,7 @@ import "IPaneContent.idl"; import "TerminalSettingsCache.idl"; +import "FilteredCommand.idl"; namespace TerminalApp { @@ -16,4 +17,20 @@ namespace TerminalApp event Windows.Foundation.TypedEventHandler RestartTerminalRequested; } + + [default_interface] runtimeclass FilteredTask : TerminalApp.FilteredCommand + { + String Input{ get; }; + Windows.Foundation.Collections.IObservableVector Children { get; }; + Windows.UI.Xaml.Visibility Visibility { get; }; + } + + [default_interface] runtimeclass TasksPaneContent : Windows.UI.Xaml.Controls.UserControl, IPaneContent + { + TasksPaneContent(); + void SetLastActiveControl(Microsoft.Terminal.Control.TermControl control); + + event Windows.Foundation.TypedEventHandler DispatchCommandRequested; + + } } diff --git a/src/cascadia/TerminalApp/TerminalTab.cpp b/src/cascadia/TerminalApp/TerminalTab.cpp index d3e52d4037d..f4c45243519 100644 --- a/src/cascadia/TerminalApp/TerminalTab.cpp +++ b/src/cascadia/TerminalApp/TerminalTab.cpp @@ -1249,6 +1249,18 @@ namespace winrt::TerminalApp::implementation // Raise our own ActivePaneChanged event. ActivePaneChanged.raise(); + + const auto content{ pane->GetContent() }; + if (const auto termContent{ content.try_as() }) + { + const auto& termControl{ termContent.GetTermControl() }; + _rootPane->WalkTree([termControl](const auto& p) { + if (const auto& taskPane{ p->GetContent().try_as() }) + { + taskPane.SetLastActiveControl(termControl); + } + }); + } } // Method Description: diff --git a/src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp b/src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp index 7bba13bc4cc..6dd2a8c1109 100644 --- a/src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp +++ b/src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp @@ -98,6 +98,7 @@ static constexpr std::string_view RestartConnectionKey{ "restartConnection" }; static constexpr std::string_view ToggleBroadcastInputKey{ "toggleBroadcastInput" }; static constexpr std::string_view OpenScratchpadKey{ "experimental.openScratchpad" }; static constexpr std::string_view OpenAboutKey{ "openAbout" }; +static constexpr std::string_view OpenTasksPaneKey{ "experimental.openTasks" }; static constexpr std::string_view ActionKey{ "action" }; @@ -434,6 +435,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation { ShortcutAction::ToggleBroadcastInput, RS_(L"ToggleBroadcastInputCommandKey") }, { ShortcutAction::OpenScratchpad, RS_(L"OpenScratchpadKey") }, { ShortcutAction::OpenAbout, RS_(L"OpenAboutCommandKey") }, + { ShortcutAction::OpenTasksPane, RS_(L"OpenTasksPaneCommandKey") }, }; }(); diff --git a/src/cascadia/TerminalSettingsModel/ActionMap.cpp b/src/cascadia/TerminalSettingsModel/ActionMap.cpp index 220cd825565..6833b522a43 100644 --- a/src/cascadia/TerminalSettingsModel/ActionMap.cpp +++ b/src/cascadia/TerminalSettingsModel/ActionMap.cpp @@ -964,17 +964,27 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation cmdImpl.copy_from(winrt::get_self(command)); const auto inArgs{ command.ActionAndArgs().Args().try_as() }; - + const auto inputString{ (std::wstring_view)(inArgs ? inArgs.Input() : L"") }; auto args = winrt::make_self( winrt::hstring{ fmt::format(FMT_COMPILE(L"{:\x7f^{}}{}"), L"", numBackspaces, - (std::wstring_view)(inArgs ? inArgs.Input() : L"")) }); + inputString) }); Model::ActionAndArgs actionAndArgs{ ShortcutAction::SendInput, *args }; auto copy = cmdImpl->Copy(); copy->ActionAndArgs(actionAndArgs); + if (!copy->HasName()) + { + // Here, we want to manually generate a send input name, but + // without visualizing space and backspace + // + // TODO! Do we want to include `Send Input: ` in the generated + // string? I think it looks better without it tbh + copy->Name(winrt::hstring{ til::visualize_nonspace_control_codes(std::wstring{ inputString }) }); + } + return *copy; }; diff --git a/src/cascadia/TerminalSettingsModel/AllShortcutActions.h b/src/cascadia/TerminalSettingsModel/AllShortcutActions.h index 28ba4281e69..39de2323199 100644 --- a/src/cascadia/TerminalSettingsModel/AllShortcutActions.h +++ b/src/cascadia/TerminalSettingsModel/AllShortcutActions.h @@ -111,7 +111,8 @@ ON_ALL_ACTIONS(RestartConnection) \ ON_ALL_ACTIONS(ToggleBroadcastInput) \ ON_ALL_ACTIONS(OpenScratchpad) \ - ON_ALL_ACTIONS(OpenAbout) + ON_ALL_ACTIONS(OpenAbout) \ + ON_ALL_ACTIONS(OpenTasksPane) #define ALL_SHORTCUT_ACTIONS_WITH_ARGS \ ON_ALL_ACTIONS_WITH_ARGS(AdjustFontSize) \ diff --git a/src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw b/src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw index 6179099bdf5..2f0e5fd5362 100644 --- a/src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw @@ -727,4 +727,8 @@ Open about dialog This will open the "about" dialog, to display version info and other documentation - \ No newline at end of file + + Open tasks pane + This will open a pane with a list of the users's saved commands in it + + diff --git a/src/cascadia/TerminalSettingsModel/defaults.json b/src/cascadia/TerminalSettingsModel/defaults.json index 468c2120acf..475f4039a84 100644 --- a/src/cascadia/TerminalSettingsModel/defaults.json +++ b/src/cascadia/TerminalSettingsModel/defaults.json @@ -447,6 +447,7 @@ { "command": "quit", "id": "Terminal.Quit" }, { "command": "restoreLastClosed", "id": "Terminal.RestoreLastClosed" }, { "command": "openAbout", "id": "Terminal.OpenAboutDialog" }, + { "command": "experimental.openTasks", "id": "Terminal.OpenTasks" }, // Tab Management // "command": "closeTab" is unbound by default. diff --git a/src/cascadia/inc/cppwinrt_utils.h b/src/cascadia/inc/cppwinrt_utils.h index 17c720614b1..fa1575d32ae 100644 --- a/src/cascadia/inc/cppwinrt_utils.h +++ b/src/cascadia/inc/cppwinrt_utils.h @@ -133,7 +133,7 @@ public: \ _##name = value; \ } \ \ -private: \ +protected: \ type _##name{ __VA_ARGS__ }; // Use this macro to quickly implement both the getter and setter for an @@ -158,7 +158,7 @@ public: } \ }; \ \ -private: \ +protected: \ type _##name{ __VA_ARGS__ }; \ void _set##name(const type& value) \ { \ diff --git a/src/inc/til/string.h b/src/inc/til/string.h index fcb6905e282..33570ffe621 100644 --- a/src/inc/til/string.h +++ b/src/inc/til/string.h @@ -24,6 +24,26 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned" } return str; } + _TIL_INLINEPREFIX std::wstring visualize_nonspace_control_codes(std::wstring str) noexcept + { + for (auto& ch : str) + { + // NOT backspace! + if (ch < 0x20 && ch != 0x08) + { + ch += 0x2400; + } + // else if (ch == 0x20) + // { + // ch = 0x2423; // replace space with ␣ + // } + else if (ch == 0x7f) + { + ch = 0x2421; // replace del with ␡ + } + } + return str; + } _TIL_INLINEPREFIX std::wstring visualize_control_codes(std::wstring_view str) { From 43d46dbc9916de98eaf5d9a606f803adfeae2d87 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Thu, 2 May 2024 17:04:58 -0500 Subject: [PATCH 02/24] hey it runs again --- src/cascadia/TerminalApp/TasksPaneContent.cpp | 4 ++-- src/cascadia/TerminalApp/TasksPaneContent.h | 16 ++++++++-------- src/cascadia/TerminalApp/TasksPaneContent.xaml | 4 ++-- src/cascadia/TerminalApp/TerminalPage.cpp | 10 ++++++++++ src/cascadia/TerminalApp/TerminalPaneContent.h | 1 + 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/cascadia/TerminalApp/TasksPaneContent.cpp b/src/cascadia/TerminalApp/TasksPaneContent.cpp index 1f941a17ad1..113ca0122ff 100644 --- a/src/cascadia/TerminalApp/TasksPaneContent.cpp +++ b/src/cascadia/TerminalApp/TasksPaneContent.cpp @@ -86,9 +86,9 @@ namespace winrt::TerminalApp::implementation CloseRequested.raise(*this, nullptr); } - NewTerminalArgs TasksPaneContent::GetNewTerminalArgs(const bool /* asContent */) const + INewContentArgs TasksPaneContent::GetNewTerminalArgs(BuildStartupKind /*kind*/) const { - return nullptr; + return BaseContentArgs(L"snippets"); } winrt::hstring TasksPaneContent::Icon() const diff --git a/src/cascadia/TerminalApp/TasksPaneContent.h b/src/cascadia/TerminalApp/TasksPaneContent.h index 935b18a70b3..7aa1f1be486 100644 --- a/src/cascadia/TerminalApp/TasksPaneContent.h +++ b/src/cascadia/TerminalApp/TasksPaneContent.h @@ -20,7 +20,7 @@ namespace winrt::TerminalApp::implementation winrt::Windows::Foundation::Size MinimumSize(); void Focus(winrt::Windows::UI::Xaml::FocusState reason = winrt::Windows::UI::Xaml::FocusState::Programmatic); void Close(); - winrt::Microsoft::Terminal::Settings::Model::NewTerminalArgs GetNewTerminalArgs(const bool asContent) const; + winrt::Microsoft::Terminal::Settings::Model::INewContentArgs GetNewTerminalArgs(BuildStartupKind kind) const; // TODO! lots of strings here and in XAML that need RS_-ifying winrt::hstring Title() { return L"Tasks"; } @@ -33,14 +33,14 @@ namespace winrt::TerminalApp::implementation void SetLastActiveControl(const Microsoft::Terminal::Control::TermControl& control); - til::typed_event<> CloseRequested; - til::typed_event BellRequested; - til::typed_event<> TitleChanged; - til::typed_event<> TabColorChanged; - til::typed_event<> TaskbarProgressChanged; til::typed_event<> ConnectionStateChanged; - til::typed_event<> ReadOnlyChanged; - til::typed_event<> FocusRequested; + til::typed_event CloseRequested; + til::typed_event BellRequested; + til::typed_event TitleChanged; + til::typed_event TabColorChanged; + til::typed_event TaskbarProgressChanged; + til::typed_event ReadOnlyChanged; + til::typed_event FocusRequested; til::typed_event DispatchCommandRequested; diff --git a/src/cascadia/TerminalApp/TasksPaneContent.xaml b/src/cascadia/TerminalApp/TasksPaneContent.xaml index c13830b9416..6a8a7d2e7e0 100644 --- a/src/cascadia/TerminalApp/TasksPaneContent.xaml +++ b/src/cascadia/TerminalApp/TasksPaneContent.xaml @@ -10,6 +10,7 @@ xmlns:local="using:TerminalApp" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:model="using:Microsoft.Terminal.Settings.Model" + xmlns:mtu="using:Microsoft.Terminal.UI" xmlns:mux="using:Microsoft.UI.Xaml.Controls" AllowFocusOnInteraction="True" IsTabStop="True" @@ -18,7 +19,6 @@ - @@ -38,7 +38,7 @@ diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index 70af18b7434..c57e4bdfb7a 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -23,6 +23,7 @@ #include "DebugTapConnection.h" #include "SettingsPaneContent.h" #include "ScratchpadContent.h" +#include "TasksPaneContent.h" #include "TabRowControl.h" #include "Utils.h" @@ -3177,6 +3178,15 @@ namespace winrt::TerminalApp::implementation { content = _makeSettingsContent(); } + else if (paneType == L"snippets") + { + const auto& tasksContent{ winrt::make_self() }; + tasksContent->UpdateSettings(_settings); + tasksContent->GetRoot().KeyDown({ this, &TerminalPage::_KeyDownHandler }); + tasksContent->DispatchCommandRequested({ this, &TerminalPage::_OnDispatchCommandRequested }); + + content = *tasksContent; + } assert(content); diff --git a/src/cascadia/TerminalApp/TerminalPaneContent.h b/src/cascadia/TerminalApp/TerminalPaneContent.h index 2995e5f1872..d5a55947b3d 100644 --- a/src/cascadia/TerminalApp/TerminalPaneContent.h +++ b/src/cascadia/TerminalApp/TerminalPaneContent.h @@ -51,6 +51,7 @@ namespace winrt::TerminalApp::implementation Windows::Foundation::Size GridUnitSize(); til::typed_event RestartTerminalRequested; + til::typed_event<> ConnectionStateChanged; til::typed_event CloseRequested; til::typed_event BellRequested; From 7b8b60bdefa21e0bda65571248f30ba6e28d89fb Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 3 May 2024 14:44:40 -0500 Subject: [PATCH 03/24] resources to localize --- .../Resources/en-US/Resources.resw | 11 ++++++ src/cascadia/TerminalApp/TasksPaneContent.cpp | 4 +-- src/cascadia/TerminalApp/TasksPaneContent.h | 4 +-- .../TerminalApp/TasksPaneContent.xaml | 35 ++++++++++++++----- 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw index 15b79c40ffc..3f41fd31372 100644 --- a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw @@ -898,4 +898,15 @@ Restart the active pane connection + + Snippets + Header for a page that includes small snippets of text for the user to enter + + + Filter snippets... + Placeholder text for a text box to filter snippets (on the same page as the 'SnippetPaneTitle') + + + Input this command + diff --git a/src/cascadia/TerminalApp/TasksPaneContent.cpp b/src/cascadia/TerminalApp/TasksPaneContent.cpp index 113ca0122ff..ba40a16007e 100644 --- a/src/cascadia/TerminalApp/TasksPaneContent.cpp +++ b/src/cascadia/TerminalApp/TasksPaneContent.cpp @@ -23,8 +23,8 @@ namespace winrt::TerminalApp::implementation { InitializeComponent(); - auto res = Windows::UI::Xaml::Application::Current().Resources(); - auto bg = res.Lookup(winrt::box_value(L"UnfocusedBorderBrush")); + // auto res = Windows::UI::Xaml::Application::Current().Resources(); + auto bg = Resources().Lookup(winrt::box_value(L"PageBackground")); Background(bg.try_as()); } diff --git a/src/cascadia/TerminalApp/TasksPaneContent.h b/src/cascadia/TerminalApp/TasksPaneContent.h index 7aa1f1be486..eccc4b3c0ab 100644 --- a/src/cascadia/TerminalApp/TasksPaneContent.h +++ b/src/cascadia/TerminalApp/TasksPaneContent.h @@ -6,6 +6,7 @@ #include "FilteredTask.g.h" #include "FilteredCommand.h" #include "ActionPaletteItem.h" +#include namespace winrt::TerminalApp::implementation { @@ -23,7 +24,7 @@ namespace winrt::TerminalApp::implementation winrt::Microsoft::Terminal::Settings::Model::INewContentArgs GetNewTerminalArgs(BuildStartupKind kind) const; // TODO! lots of strings here and in XAML that need RS_-ifying - winrt::hstring Title() { return L"Tasks"; } + winrt::hstring Title() { return RS_(L"SnippetPaneTitle/Text"); } uint64_t TaskbarState() { return 0; } uint64_t TaskbarProgress() { return 0; } bool ReadOnly() { return false; } @@ -49,7 +50,6 @@ namespace winrt::TerminalApp::implementation winrt::weak_ref _control{ nullptr }; winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr }; - winrt::Windows::Foundation::Collections::IObservableVector _allTasks{ nullptr }; void _runCommandButtonClicked(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs&); diff --git a/src/cascadia/TerminalApp/TasksPaneContent.xaml b/src/cascadia/TerminalApp/TasksPaneContent.xaml index 6a8a7d2e7e0..7c4398209d4 100644 --- a/src/cascadia/TerminalApp/TasksPaneContent.xaml +++ b/src/cascadia/TerminalApp/TasksPaneContent.xaml @@ -42,15 +42,15 @@ Visibility="Collapsed" /> -