Skip to content

Commit 38de95e

Browse files
committed
Code review notes
1 parent 5849279 commit 38de95e

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

src/cascadia/CascadiaPackage/Package-Dev.appxmanifest

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
<com:ComInterface>
100100
<com:ProxyStub Id="DEC4804D-56D1-4F73-9FBE-6828E7C85C56" DisplayName="OpenConsoleHandoffProxy" Path="OpenConsoleProxy.dll"/>
101101
<com:Interface Id="E686C757-9A35-4A1C-B3CE-0BCC8B5C69F4" ProxyStubClsid="DEC4804D-56D1-4F73-9FBE-6828E7C85C56"/>
102-
<com:Interface Id="AA6B364F-4A50-4176-9002-0AE755E7B5EF" ProxyStubClsid="DEC4804D-56D1-4F73-9FBE-6828E7C85C56"/>
102+
<com:Interface Id="59D55CCE-FC8A-48B4-ACE8-0A9286C6557F" ProxyStubClsid="DEC4804D-56D1-4F73-9FBE-6828E7C85C56"/> <!-- ITerminalHandoff -->
103+
<com:Interface Id="AA6B364F-4A50-4176-9002-0AE755E7B5EF" ProxyStubClsid="DEC4804D-56D1-4F73-9FBE-6828E7C85C56"/> <!-- ITerminalHandoff2 -->
103104
<com:Interface Id="746E6BC0-AB05-4E38-AB14-71E86763141F" ProxyStubClsid="DEC4804D-56D1-4F73-9FBE-6828E7C85C56"/>
104105
</com:ComInterface>
105106
</com:Extension>

src/cascadia/CascadiaPackage/Package-Pre.appxmanifest

+2-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@
188188
<com:ComInterface>
189189
<com:ProxyStub Id="1833E661-CC81-4DD0-87C6-C2F74BD39EFA" DisplayName="OpenConsoleHandoffProxy" Path="OpenConsoleProxy.dll"/>
190190
<com:Interface Id="E686C757-9A35-4A1C-B3CE-0BCC8B5C69F4" ProxyStubClsid="1833E661-CC81-4DD0-87C6-C2F74BD39EFA"/>
191-
<com:Interface Id="AA6B364F-4A50-4176-9002-0AE755E7B5EF" ProxyStubClsid="1833E661-CC81-4DD0-87C6-C2F74BD39EFA"/>
191+
<com:Interface Id="59D55CCE-FC8A-48B4-ACE8-0A9286C6557F" ProxyStubClsid="1833E661-CC81-4DD0-87C6-C2F74BD39EFA"/> <!-- ITerminalHandoff -->
192+
<com:Interface Id="AA6B364F-4A50-4176-9002-0AE755E7B5EF" ProxyStubClsid="1833E661-CC81-4DD0-87C6-C2F74BD39EFA"/> <!-- ITerminalHandoff2 -->
192193
<com:Interface Id="746E6BC0-AB05-4E38-AB14-71E86763141F" ProxyStubClsid="1833E661-CC81-4DD0-87C6-C2F74BD39EFA"/>
193194
</com:ComInterface>
194195
</com:Extension>

src/cascadia/CascadiaPackage/Package.appxmanifest

+2-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@
188188
<com:ComInterface>
189189
<com:ProxyStub Id="3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F" DisplayName="OpenConsoleHandoffProxy" Path="OpenConsoleProxy.dll"/>
190190
<com:Interface Id="E686C757-9A35-4A1C-B3CE-0BCC8B5C69F4" ProxyStubClsid="3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F"/>
191-
<com:Interface Id="AA6B364F-4A50-4176-9002-0AE755E7B5EF" ProxyStubClsid="3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F"/>
191+
<com:Interface Id="59D55CCE-FC8A-48B4-ACE8-0A9286C6557F" ProxyStubClsid="1833E661-CC81-4DD0-87C6-C2F74BD39EFA"/> <!-- ITerminalHandoff -->
192+
<com:Interface Id="AA6B364F-4A50-4176-9002-0AE755E7B5EF" ProxyStubClsid="1833E661-CC81-4DD0-87C6-C2F74BD39EFA"/> <!-- ITerminalHandoff2 -->
192193
<com:Interface Id="746E6BC0-AB05-4E38-AB14-71E86763141F" ProxyStubClsid="3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F"/>
193194
</com:ComInterface>
194195
</com:Extension>

src/cascadia/TerminalApp/TerminalPage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3270,7 +3270,7 @@ namespace winrt::TerminalApp::implementation
32703270
{
32713271
NewTerminalArgs newTerminalArgs;
32723272
newTerminalArgs.Commandline(connection.Commandline());
3273-
newTerminalArgs.TabTitle(connection.Title());
3273+
newTerminalArgs.TabTitle(connection.StartingTitle());
32743274
// GH #12370: We absolutely cannot allow a defterm connection to
32753275
// auto-elevate. Defterm doesn't work for elevated scenarios in the
32763276
// first place. If we try accepting the connection, the spawning an

src/cascadia/TerminalConnection/ConptyConnection.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
214214
THROW_IF_FAILED(ConptyPackPseudoConsole(hServerProcess, hRef, hSig, &_hPC));
215215
_piClient.hProcess = hClientProcess;
216216

217-
_startupInfo.title = winrt::hstring{ startupInfo.pszTitle };
218-
_startupInfo.iconPath = winrt::hstring{ startupInfo.pszIconPath };
217+
_startupInfo.title = winrt::hstring{ startupInfo.pszTitle, SysStringLen(startupInfo.pszTitle) };
218+
SysFreeString(startupInfo.pszTitle);
219+
_startupInfo.iconPath = winrt::hstring{ startupInfo.pszIconPath, SysStringLen(startupInfo.pszIconPath) };
220+
SysFreeString(startupInfo.pszIconPath);
219221
_startupInfo.iconIndex = startupInfo.iconIndex;
220222

221223
try
@@ -293,7 +295,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
293295
return _commandline;
294296
}
295297

296-
winrt::hstring ConptyConnection::Title() const
298+
winrt::hstring ConptyConnection::StartingTitle() const
297299
{
298300
return _startupInfo.title;
299301
}

src/cascadia/TerminalConnection/ConptyConnection.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
4545

4646
winrt::guid Guid() const noexcept;
4747
winrt::hstring Commandline() const;
48-
winrt::hstring Title() const;
48+
winrt::hstring StartingTitle() const;
4949

5050
static void StartInboundListener();
5151
static void StopInboundListener();

src/cascadia/TerminalConnection/ConptyConnection.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.Terminal.TerminalConnection
1212
ConptyConnection();
1313
Guid Guid { get; };
1414
String Commandline { get; };
15-
String Title { get; };
15+
String StartingTitle { get; };
1616

1717
void ClearBuffer();
1818

src/host/proxy/ITerminalHandoff.idl

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import "ocidl.idl";
88
typedef struct _TERMINAL_STARTUP_INFO
99
{
1010
// In STARTUPINFO
11-
LPCWSTR pszTitle;
11+
BSTR pszTitle;
1212

1313
// Also wanted
14-
LPCWSTR pszIconPath;
14+
BSTR pszIconPath;
1515
LONG iconIndex;
1616

1717
// The rest of STARTUPINFO
@@ -24,10 +24,6 @@ typedef struct _TERMINAL_STARTUP_INFO
2424
DWORD dwFillAttribute;
2525
DWORD dwFlags;
2626
WORD wShowWindow;
27-
28-
// Something else we may be interested in?
29-
LPCWSTR fontFace;
30-
LONG fontSize;
3127
} TERMINAL_STARTUP_INFO;
3228

3329
// LOAD BEARING!

src/host/srvinit.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,11 @@ try
576576
// END code from SetUpConsole
577577

578578
// Take what we've collected, and bundle it up for handoff.
579+
auto title = wil::make_bstr(Cac.Title);
580+
auto iconPath = wil::make_bstr(icon.path.data());
579581
TERMINAL_STARTUP_INFO myStartupInfo{
580-
Cac.Title,
581-
icon.path.c_str(),
582+
title.get(),
583+
iconPath.get(),
582584
icon.index
583585
};
584586

0 commit comments

Comments
 (0)