@industry-theme/xterm-terminal-panel 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1439,6 +1439,7 @@ import React2, {
|
|
|
1439
1439
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1440
1440
|
function TerminalTabContentInner(props, ref) {
|
|
1441
1441
|
const { tab, sessionId, isActive, isVisible, actions, events, terminalContext, onSessionCreated, onScrollPositionChange, isForeign = false, defaultScrollLocked } = props;
|
|
1442
|
+
console.log("[TerminalTabContent] RENDER", { tabId: tab.id, isActive, sessionId });
|
|
1442
1443
|
const terminalRef = useRef3(null);
|
|
1443
1444
|
const [localSessionId, setLocalSessionId] = useState4(sessionId);
|
|
1444
1445
|
const [isInitialized, setIsInitialized] = useState4(false);
|
|
@@ -1521,15 +1522,17 @@ function TerminalTabContentInner(props, ref) {
|
|
|
1521
1522
|
if (!actions.onTerminalData) {
|
|
1522
1523
|
return;
|
|
1523
1524
|
}
|
|
1525
|
+
console.log("[TerminalTabContent] SUBSCRIBING to terminal data", { tabId: tab.id, sessionId: localSessionId });
|
|
1524
1526
|
const unsubscribe = actions.onTerminalData(localSessionId, (data) => {
|
|
1525
1527
|
if (terminalRef.current) {
|
|
1526
1528
|
terminalRef.current.write(data);
|
|
1527
1529
|
}
|
|
1528
1530
|
});
|
|
1529
1531
|
return () => {
|
|
1532
|
+
console.log("[TerminalTabContent] UNSUBSCRIBING from terminal data", { tabId: tab.id, sessionId: localSessionId });
|
|
1530
1533
|
unsubscribe();
|
|
1531
1534
|
};
|
|
1532
|
-
}, [localSessionId, isInitialized, actions, shouldRenderTerminal]);
|
|
1535
|
+
}, [localSessionId, isInitialized, actions, shouldRenderTerminal, tab.id]);
|
|
1533
1536
|
const handleData = useCallback3((data) => {
|
|
1534
1537
|
if (localSessionId && actions.writeToTerminal) {
|
|
1535
1538
|
actions.writeToTerminal(localSessionId, data);
|
|
@@ -1687,6 +1690,9 @@ var areTerminalTabContentPropsEqual = (prevProps, nextProps) => {
|
|
|
1687
1690
|
changes.push("terminalContext");
|
|
1688
1691
|
if (prevProps.isForeign !== nextProps.isForeign)
|
|
1689
1692
|
changes.push("isForeign");
|
|
1693
|
+
if (changes.length > 0) {
|
|
1694
|
+
console.log("[TerminalTabContent] MEMO - will re-render, props changed:", changes, { tabId: nextProps.tab.id });
|
|
1695
|
+
}
|
|
1690
1696
|
return changes.length === 0;
|
|
1691
1697
|
};
|
|
1692
1698
|
var TerminalTabContentForwarded = React2.forwardRef(TerminalTabContentInner);
|
|
@@ -1715,6 +1721,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
1715
1721
|
requestFocusTabId,
|
|
1716
1722
|
onFocusTabHandled
|
|
1717
1723
|
}) => {
|
|
1724
|
+
console.log("[TabbedTerminalPanel] RENDER", { terminalContext, directory, width });
|
|
1718
1725
|
const { theme } = useTheme6();
|
|
1719
1726
|
const [ownedTabs, setOwnedTabs] = useState4(initialTabs);
|
|
1720
1727
|
const [foreignTabs, setForeignTabs] = useState4([]);
|
|
@@ -1737,7 +1744,6 @@ var TabbedTerminalPanelInner = ({
|
|
|
1737
1744
|
}, [initialTabs]);
|
|
1738
1745
|
useEffect4(() => {
|
|
1739
1746
|
const customTabsFromProp = initialTabs.filter((tab) => tab.contentType !== "terminal");
|
|
1740
|
-
console.log("[DEBUG TabbedTerminalPanel] Sync useEffect triggered. customTabsFromProp:", customTabsFromProp.map((t) => t.id));
|
|
1741
1747
|
setOwnedTabs((prevTabs) => {
|
|
1742
1748
|
const existingTerminalTabs = prevTabs.filter((tab) => tab.contentType === "terminal");
|
|
1743
1749
|
const customTabIds = new Set(customTabsFromProp.map((t) => t.id));
|
|
@@ -1747,8 +1753,6 @@ var TabbedTerminalPanelInner = ({
|
|
|
1747
1753
|
...existingCustomTabs,
|
|
1748
1754
|
...customTabsFromProp
|
|
1749
1755
|
];
|
|
1750
|
-
console.log("[DEBUG TabbedTerminalPanel] prevTabs custom:", prevTabs.filter((t) => t.contentType !== "terminal").map((t) => t.id));
|
|
1751
|
-
console.log("[DEBUG TabbedTerminalPanel] mergedTabs custom:", mergedTabs.filter((t) => t.contentType !== "terminal").map((t) => t.id));
|
|
1752
1756
|
const prevCustomTabs = prevTabs.filter((tab) => tab.contentType !== "terminal");
|
|
1753
1757
|
const customTabsChanged = prevCustomTabs.length !== customTabsFromProp.length || !customTabsFromProp.every((tab) => {
|
|
1754
1758
|
const prev = prevCustomTabs.find((p) => p.id === tab.id);
|
|
@@ -1756,12 +1760,9 @@ var TabbedTerminalPanelInner = ({
|
|
|
1756
1760
|
return false;
|
|
1757
1761
|
return JSON.stringify(tab) === JSON.stringify(prev);
|
|
1758
1762
|
});
|
|
1759
|
-
console.log("[DEBUG TabbedTerminalPanel] customTabsChanged:", customTabsChanged);
|
|
1760
1763
|
if (!customTabsChanged) {
|
|
1761
|
-
console.log("[DEBUG TabbedTerminalPanel] No change, returning prevTabs");
|
|
1762
1764
|
return prevTabs;
|
|
1763
1765
|
}
|
|
1764
|
-
console.log("[DEBUG TabbedTerminalPanel] Updating to mergedTabs");
|
|
1765
1766
|
return mergedTabs;
|
|
1766
1767
|
});
|
|
1767
1768
|
}, [customTabsKey]);
|
|
@@ -2002,8 +2003,6 @@ var TabbedTerminalPanelInner = ({
|
|
|
2002
2003
|
} else {
|
|
2003
2004
|
setOwnedTabs((prevTabs) => {
|
|
2004
2005
|
const newTabs = prevTabs.filter((t) => t.id !== tabId);
|
|
2005
|
-
console.log("[DEBUG TabbedTerminalPanel] closeTab removing:", tabId);
|
|
2006
|
-
console.log("[DEBUG TabbedTerminalPanel] closeTab calling onTabsChange with:", newTabs.map((t) => t.id));
|
|
2007
2006
|
const nextActiveId = findNextActiveTab([...newTabs, ...foreignTabs]);
|
|
2008
2007
|
if (nextActiveId !== activeTabId) {
|
|
2009
2008
|
setActiveTabId(nextActiveId);
|
|
@@ -2278,6 +2277,19 @@ var TabbedTerminalPanelMemoized = React2.memo(TabbedTerminalPanelInner, (prevPro
|
|
|
2278
2277
|
changes.push("activeTabId");
|
|
2279
2278
|
if (prevProps.onActiveTabChange !== nextProps.onActiveTabChange)
|
|
2280
2279
|
changes.push("onActiveTabChange");
|
|
2280
|
+
const ignoredChanges = [];
|
|
2281
|
+
if (prevProps.context !== nextProps.context)
|
|
2282
|
+
ignoredChanges.push("context");
|
|
2283
|
+
if (prevProps.events !== nextProps.events)
|
|
2284
|
+
ignoredChanges.push("events");
|
|
2285
|
+
console.log("[TabbedTerminalPanel] MEMO check", {
|
|
2286
|
+
willRerender: changes.length > 0,
|
|
2287
|
+
propsChanged: changes.length > 0 ? changes : "none",
|
|
2288
|
+
ignoredPropsChanged: ignoredChanges.length > 0 ? ignoredChanges : "none"
|
|
2289
|
+
});
|
|
2290
|
+
if (changes.length > 0) {
|
|
2291
|
+
console.log("[TabbedTerminalPanel] MEMO - will re-render, props changed:", changes);
|
|
2292
|
+
}
|
|
2281
2293
|
return changes.length === 0;
|
|
2282
2294
|
});
|
|
2283
2295
|
TabbedTerminalPanelMemoized.displayName = "TabbedTerminalPanel";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabbedTerminalPanel.d.ts","sourceRoot":"","sources":["../../../src/panels/TabbedTerminalPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAKN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EAIZ,MAAM,gBAAgB,CAAC;AA2BxB,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;
|
|
1
|
+
{"version":3,"file":"TabbedTerminalPanel.d.ts","sourceRoot":"","sources":["../../../src/panels/TabbedTerminalPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAKN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EAIZ,MAAM,gBAAgB,CAAC;AA2BxB,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AA6pCD,eAAO,MAAM,mBAAmB,EAAkC,CAAC,IAAI,SAAS,OAAO,cAAc,EAAE,OAAO,GAAG,WAAW,EAC1H,KAAK,EAAE,wBAAwB,CAAC,IAAI,CAAC,KAClC,KAAK,CAAC,YAAY,CAAC"}
|
package/package.json
CHANGED