aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTMY <93774927+TMYTiMidlY@users.noreply.github.com>2026-04-02 18:05:51 +0800
committerGitHub <noreply@github.com>2026-04-02 12:05:51 +0200
commit0532949bbdcee5116e91807ddb45a85d78a2aafc (patch)
tree7b4374061700a7520226bf326bf95d3166f27565
parentFix bce and other issues (#4992) (diff)
downloadsl0ppij-0532949bbdcee5116e91807ddb45a85d78a2aafc.tar.gz
sl0ppij-0532949bbdcee5116e91807ddb45a85d78a2aafc.tar.xz
sl0ppij-0532949bbdcee5116e91807ddb45a85d78a2aafc.zip
fix(web-client): use base URL when switching sessions (#4981)
* fix(web-client): use base URL when switching sessions Session switch redirected to /{session_name} instead of {base_url}/{session_name}, breaking reverse proxy setups. Use getBaseUrl() to construct the redirect URL, consistent with how auth.js and connection.js already handle base URL. Fixes #4980 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(web-client): encode session name in redirect URL Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: update changelog --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Thomas Linford <linford.t@gmail.com>
-rw-r--r--CHANGELOG.md1
-rw-r--r--zellij-client/assets/websockets.js5
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 62edea0a..221b19b9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
* fix: remote attach issues on macOS (https://github.com/zellij-org/zellij/pull/4972)
* test: improve e2e test reliability and local macOS dev support (https://github.com/zellij-org/zellij/pull/4952)
* fix: preserve background color in trailing and skipped characters (https://github.com/zellij-org/zellij/pull/4992)
+* fix: make web client use base URL when switching sessions (https://github.com/zellij-org/zellij/pull/4981)
## [0.44.0] - 2026-03-23
* fix: meta key handling in web client (https://github.com/zellij-org/zellij/pull/4376)
diff --git a/zellij-client/assets/websockets.js b/zellij-client/assets/websockets.js
index 8a3f85ba..d2553bc7 100644
--- a/zellij-client/assets/websockets.js
+++ b/zellij-client/assets/websockets.js
@@ -3,7 +3,7 @@
*/
import { handleReconnection, handleDisconnected, markConnectionEstablished } from "./connection.js";
-import { getWebSocketBaseUrl } from "./utils.js";
+import { getBaseUrl, getWebSocketBaseUrl } from "./utils.js";
/**
* Initialize both terminal and control WebSocket connections
@@ -241,7 +241,8 @@ function startWsControl(wsControl, term, fitAddon, ownWebClientId, userConfig) {
}
} else if (msg.type === "SwitchedSession") {
const { new_session_name } = msg;
- window.location.pathname = `/${new_session_name}`;
+ const baseUrl = getBaseUrl();
+ window.location.href = `${baseUrl}/${encodeURIComponent(new_session_name)}`;
}
};