@industry-theme/xterm-terminal-panel 0.5.22 → 0.5.23
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
|
@@ -1975,15 +1975,36 @@ function TerminalTabContentInner(props, ref) {
|
|
|
1975
1975
|
const initSession = async () => {
|
|
1976
1976
|
try {
|
|
1977
1977
|
if (sessionId) {
|
|
1978
|
+
const tracer2 = getTracer();
|
|
1979
|
+
const reconnectSpan = tracer2.startSpan("terminal.session.reconnect", {
|
|
1980
|
+
attributes: {
|
|
1981
|
+
"session.id": sessionId,
|
|
1982
|
+
"session.context": `${terminalContext}:${tab.id}`,
|
|
1983
|
+
"session.isForeign": isForeign
|
|
1984
|
+
}
|
|
1985
|
+
});
|
|
1986
|
+
reconnectSpan.addEvent("terminal.session.reconnecting", {
|
|
1987
|
+
"session.id": sessionId,
|
|
1988
|
+
"reconnect.reason": "component_remount"
|
|
1989
|
+
});
|
|
1978
1990
|
if (isForeign && actions.checkTerminalOwnership) {
|
|
1979
1991
|
const status = await actions.checkTerminalOwnership(sessionId);
|
|
1980
1992
|
if (status.ownedByWindowId && !status.ownedByThisWindow) {
|
|
1981
1993
|
setShouldRenderTerminal(false);
|
|
1982
1994
|
setOwnerWindowId(status.ownedByWindowId);
|
|
1995
|
+
reconnectSpan.addEvent("terminal.session.reconnect_blocked", {
|
|
1996
|
+
"session.id": sessionId,
|
|
1997
|
+
"owner.windowId": status.ownedByWindowId
|
|
1998
|
+
});
|
|
1983
1999
|
}
|
|
1984
2000
|
} else {
|
|
1985
2001
|
await claimAndConnect(sessionId);
|
|
2002
|
+
reconnectSpan.addEvent("terminal.session.reconnected", {
|
|
2003
|
+
"session.id": sessionId
|
|
2004
|
+
});
|
|
1986
2005
|
}
|
|
2006
|
+
reconnectSpan.setStatus({ code: SpanStatusCode.OK });
|
|
2007
|
+
reconnectSpan.end();
|
|
1987
2008
|
setLocalSessionId(sessionId);
|
|
1988
2009
|
setIsInitialized(true);
|
|
1989
2010
|
return;
|
|
@@ -2045,13 +2066,45 @@ function TerminalTabContentInner(props, ref) {
|
|
|
2045
2066
|
if (!actions.onTerminalData) {
|
|
2046
2067
|
return;
|
|
2047
2068
|
}
|
|
2069
|
+
const tracer = getTracer();
|
|
2070
|
+
const subscribeSpan = tracer.startSpan("terminal.data.subscribe", {
|
|
2071
|
+
attributes: {
|
|
2072
|
+
"session.id": localSessionId,
|
|
2073
|
+
"tab.id": tab.id
|
|
2074
|
+
}
|
|
2075
|
+
});
|
|
2076
|
+
subscribeSpan.addEvent("terminal.data.subscribed", {
|
|
2077
|
+
"session.id": localSessionId
|
|
2078
|
+
});
|
|
2048
2079
|
console.log("[TerminalTabContent] SUBSCRIBING to terminal data", { tabId: tab.id, sessionId: localSessionId });
|
|
2080
|
+
let hasReceivedData = false;
|
|
2049
2081
|
const unsubscribe = actions.onTerminalData(localSessionId, (data) => {
|
|
2050
2082
|
if (terminalRef.current) {
|
|
2083
|
+
if (!hasReceivedData) {
|
|
2084
|
+
hasReceivedData = true;
|
|
2085
|
+
subscribeSpan.addEvent("terminal.data.first_received", {
|
|
2086
|
+
"session.id": localSessionId,
|
|
2087
|
+
"data.length": data.length
|
|
2088
|
+
});
|
|
2089
|
+
}
|
|
2051
2090
|
terminalRef.current.write(data);
|
|
2052
2091
|
}
|
|
2053
2092
|
});
|
|
2093
|
+
subscribeSpan.setStatus({ code: SpanStatusCode.OK });
|
|
2094
|
+
subscribeSpan.end();
|
|
2054
2095
|
return () => {
|
|
2096
|
+
const unsubscribeSpan = tracer.startSpan("terminal.data.unsubscribe", {
|
|
2097
|
+
attributes: {
|
|
2098
|
+
"session.id": localSessionId,
|
|
2099
|
+
"tab.id": tab.id,
|
|
2100
|
+
"data.wasReceived": hasReceivedData
|
|
2101
|
+
}
|
|
2102
|
+
});
|
|
2103
|
+
unsubscribeSpan.addEvent("terminal.data.unsubscribed", {
|
|
2104
|
+
"session.id": localSessionId
|
|
2105
|
+
});
|
|
2106
|
+
unsubscribeSpan.setStatus({ code: SpanStatusCode.OK });
|
|
2107
|
+
unsubscribeSpan.end();
|
|
2055
2108
|
console.log("[TerminalTabContent] UNSUBSCRIBING from terminal data", { tabId: tab.id, sessionId: localSessionId });
|
|
2056
2109
|
unsubscribe();
|
|
2057
2110
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabbedTerminalPanel.d.ts","sourceRoot":"","sources":["../../../src/panels/TabbedTerminalPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAKN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EAMZ,MAAM,gBAAgB,CAAC;AAkExB,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":"AAIA,OAAO,KAKN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EAMZ,MAAM,gBAAgB,CAAC;AAkExB,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AA8jDD,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