Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ui/features/terminal/Terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ const TerminalInner = forwardRef<TerminalHandle, SSHTerminalProps>(
currentHostConfigRef.current = hostConfig;

const persistenceEnabled =
localStorage.getItem("enableTerminalSessionPersistence") === "true";
localStorage.getItem("enableTerminalSessionPersistence") !== "false";
const tabId = hostConfig.instanceId
? `${hostConfig.id}_${hostConfig.instanceId}`
: `${hostConfig.id}_${Date.now()}`;
Expand Down Expand Up @@ -1455,8 +1455,8 @@ const TerminalInner = forwardRef<TerminalHandle, SSHTerminalProps>(
} else if (msg.type === "sessionCreated") {
sessionIdRef.current = msg.sessionId;
const persistenceEnabled =
localStorage.getItem("enableTerminalSessionPersistence") ===
"true";
localStorage.getItem("enableTerminalSessionPersistence") !==
"false";
if (persistenceEnabled && hostConfig.instanceId) {
const tabId = `${hostConfig.id}_${hostConfig.instanceId}`;
localStorage.setItem(`termix_session_${tabId}`, msg.sessionId);
Expand Down Expand Up @@ -2138,7 +2138,7 @@ const TerminalInner = forwardRef<TerminalHandle, SSHTerminalProps>(
}

const persistenceEnabled =
localStorage.getItem("enableTerminalSessionPersistence") === "true";
localStorage.getItem("enableTerminalSessionPersistence") !== "false";
if (
!persistenceEnabled &&
sessionIdRef.current &&
Expand Down
4 changes: 2 additions & 2 deletions src/ui/shell/TabContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function TabProvider({ children }: TabProviderProps) {
const isElectron =
typeof window !== "undefined" && !!(window as ElectronWindow).electronAPI;
const persistenceEnabled =
localStorage.getItem("enableTerminalSessionPersistence") === "true";
localStorage.getItem("enableTerminalSessionPersistence") !== "false";
const shouldRestore = isMobile || isElectron || persistenceEnabled;

if (!shouldRestore) {
Expand Down Expand Up @@ -165,7 +165,7 @@ export function TabProvider({ children }: TabProviderProps) {
const isElectron =
typeof window !== "undefined" && !!(window as ElectronWindow).electronAPI;
const persistenceEnabled =
localStorage.getItem("enableTerminalSessionPersistence") === "true";
localStorage.getItem("enableTerminalSessionPersistence") !== "false";
const shouldSave = isMobile || isElectron || persistenceEnabled;

if (shouldSave) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/sidebar/UserProfilePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export function UserProfilePanel({
return v !== null ? v === "true" : true;
});
const [sessionPersistence, setSessionPersistence] = useState(
() => localStorage.getItem("enableTerminalSessionPersistence") === "true",
() => localStorage.getItem("enableTerminalSessionPersistence") !== "false",
);
const [showHostTags, setShowHostTags] = useState(() => {
const v = localStorage.getItem("showHostTags");
Expand Down
Loading