fix: changes for nowsh compatibility with wsl (#1422)

The wsl largely ignores most nowsh stuff, but there are some options
that can be specified for wsl. This ensures that it will still work
whether or not they are set.

Additionally if fixes the wsh not installed icon.
This commit is contained in:
Sylvie Crowe 2024-12-06 14:19:19 -08:00 committed by GitHub
parent ab565409cb
commit 66d1686e84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -714,8 +714,8 @@ const ChangeConnectionBlockModal = React.memo(
}
if (
conn.includes(connSelected) &&
connectionsConfig[conn]?.["display:hidden"] != true &&
(connectionsConfig[conn]?.["conn:wshenabled"] != false || !filterOutNowsh)
connectionsConfig?.[conn]?.["display:hidden"] != true &&
(connectionsConfig?.[conn]?.["conn:wshenabled"] != false || !filterOutNowsh)
// != false is necessary because of defaults
) {
filteredList.push(conn);
@ -728,8 +728,8 @@ const ChangeConnectionBlockModal = React.memo(
}
if (
conn.includes(connSelected) &&
connectionsConfig[conn]?.["display:hidden"] != true &&
(connectionsConfig[conn]?.["conn:wshenabled"] != false || !filterOutNowsh)
connectionsConfig?.[conn]?.["display:hidden"] != true &&
(connectionsConfig?.[conn]?.["conn:wshenabled"] != false || !filterOutNowsh)
// != false is necessary because of defaults
) {
filteredWslList.push(conn);
@ -842,8 +842,8 @@ const ChangeConnectionBlockModal = React.memo(
(itemA: SuggestionConnectionItem, itemB: SuggestionConnectionItem) => {
const connNameA = itemA.value;
const connNameB = itemB.value;
const valueA = connectionsConfig[connNameA]?.["display:order"] ?? 0;
const valueB = connectionsConfig[connNameB]?.["display:order"] ?? 0;
const valueA = connectionsConfig?.[connNameA]?.["display:order"] ?? 0;
const valueB = connectionsConfig?.[connNameB]?.["display:order"] ?? 0;
return valueA - valueB;
}
);

View File

@ -89,6 +89,7 @@ func (conn *WslConn) DeriveConnStatus() wshrpc.ConnStatus {
return wshrpc.ConnStatus{
Status: conn.Status,
Connected: conn.Status == Status_Connected,
WshEnabled: true, // always use wsh for wsl connections (temporary)
Connection: conn.GetName(),
HasConnected: (conn.LastConnectTime > 0),
ActiveConnNum: conn.ActiveConnNum,