mirror of
https://github.com/EthanShoeDev/fressh.git
synced 2026-01-11 14:22:51 +00:00
some commit
This commit is contained in:
@@ -46,7 +46,8 @@ function ShellDetail() {
|
|||||||
|
|
||||||
const listenerId = connection.addChannelListener((data: ArrayBuffer) => {
|
const listenerId = connection.addChannelListener((data: ArrayBuffer) => {
|
||||||
// Forward bytes to terminal (no string conversion)
|
// Forward bytes to terminal (no string conversion)
|
||||||
xterm?.write(new Uint8Array(data));
|
const uInt8 = new Uint8Array(data);
|
||||||
|
xterm?.write(uInt8);
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
@@ -118,7 +119,7 @@ function ShellDetail() {
|
|||||||
theme.colors.background,
|
theme.colors.background,
|
||||||
theme.colors.textPrimary,
|
theme.colors.textPrimary,
|
||||||
);
|
);
|
||||||
xtermRef.current?.setFont?.('Menlo, ui-monospace, monospace', 14);
|
xtermRef.current?.setFont?.('Menlo, ui-monospace, monospace', 50);
|
||||||
}}
|
}}
|
||||||
onMessage={(message) => {
|
onMessage={(message) => {
|
||||||
if (message.type === 'initialized') {
|
if (message.type === 'initialized') {
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ export function XtermJsWebView({
|
|||||||
// ---- RN -> WebView message sender via injectJavaScript + window MessageEvent
|
// ---- RN -> WebView message sender via injectJavaScript + window MessageEvent
|
||||||
const send = (obj: OutboundMessage) => {
|
const send = (obj: OutboundMessage) => {
|
||||||
const payload = JSON.stringify(obj);
|
const payload = JSON.stringify(obj);
|
||||||
|
console.log('sending msg', payload);
|
||||||
const js = `window.dispatchEvent(new MessageEvent('message',{data:${JSON.stringify(
|
const js = `window.dispatchEvent(new MessageEvent('message',{data:${JSON.stringify(
|
||||||
payload,
|
payload,
|
||||||
)}})); true;`;
|
)}})); true;`;
|
||||||
@@ -148,6 +149,7 @@ export function XtermJsWebView({
|
|||||||
onMessage={(event) => {
|
onMessage={(event) => {
|
||||||
try {
|
try {
|
||||||
const msg: InboundMessage = JSON.parse(event.nativeEvent.data);
|
const msg: InboundMessage = JSON.parse(event.nativeEvent.data);
|
||||||
|
console.log('received msg', msg);
|
||||||
if (msg.type === 'initialized') {
|
if (msg.type === 'initialized') {
|
||||||
onMessage?.({ type: 'initialized' });
|
onMessage?.({ type: 'initialized' });
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user