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