mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-15 21:28:40 -09:00
parent
64ec145b55
commit
f72093c9d7
1 changed files with 12 additions and 12 deletions
|
|
@ -127,9 +127,6 @@ module.exports = class Window {
|
||||||
const session = sessions.get(uid);
|
const session = sessions.get(uid);
|
||||||
if (session) {
|
if (session) {
|
||||||
session.exit();
|
session.exit();
|
||||||
} else {
|
|
||||||
//eslint-disable-next-line no-console
|
|
||||||
console.log('session not found by', uid);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
rpc.on('unmaximize', () => {
|
rpc.on('unmaximize', () => {
|
||||||
|
|
@ -143,19 +140,22 @@ module.exports = class Window {
|
||||||
});
|
});
|
||||||
rpc.on('resize', ({uid, cols, rows}) => {
|
rpc.on('resize', ({uid, cols, rows}) => {
|
||||||
const session = sessions.get(uid);
|
const session = sessions.get(uid);
|
||||||
session.resize({cols, rows});
|
if (session) {
|
||||||
|
session.resize({cols, rows});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
rpc.on('data', ({uid, data, escaped}) => {
|
rpc.on('data', ({uid, data, escaped}) => {
|
||||||
const session = sessions.get(uid);
|
const session = sessions.get(uid);
|
||||||
|
if (session) {
|
||||||
|
if (escaped) {
|
||||||
|
const escapedData = session.shell.endsWith('cmd.exe')
|
||||||
|
? `"${data}"` // This is how cmd.exe does it
|
||||||
|
: `'${data.replace(/'/g, `'\\''`)}'`; // Inside a single-quoted string nothing is interpreted
|
||||||
|
|
||||||
if (escaped) {
|
session.write(escapedData);
|
||||||
const escapedData = session.shell.endsWith('cmd.exe')
|
} else {
|
||||||
? `"${data}"` // This is how cmd.exe does it
|
session.write(data);
|
||||||
: `'${data.replace(/'/g, `'\\''`)}'`; // Inside a single-quoted string nothing is interpreted
|
}
|
||||||
|
|
||||||
session.write(escapedData);
|
|
||||||
} else {
|
|
||||||
session.write(data);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
rpc.on('open external', ({url}) => {
|
rpc.on('open external', ({url}) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue