Public Access
Merge branch 'main' into the Android head
Main grew the screens the host-management plan called for — hosts, pins, snippets, logs, import, teams — plus the ObjectStore and Import projects behind two of them, and moved WindowsDeviceKeyStore into the desktop head's Platform folder. Five of those view models landed in a directory this branch had already moved, so they join the rest in DodoSSH.Client.Shell: git spotted the rename and put them there, and the namespaces followed. Shell picks up ObjectStore and Import as a result, which the Android head then gets transitively and will use neither of at first — scoped storage means there is no ~/.ssh/config to import, and file transfer is out of its first scope. Desktop suites green at 155 and 64.
This commit is contained in:
@@ -22,6 +22,7 @@ const SERVER_SESSION_OPENED = 2;
|
||||
const SERVER_SESSION_CLOSED = 3;
|
||||
const SERVER_SESSION_ACTIVATED = 4;
|
||||
const SERVER_SESSION_REMOVED = 5;
|
||||
const SERVER_PASTE = 6;
|
||||
|
||||
const CLIENT_INPUT = 1;
|
||||
const CLIENT_ACKNOWLEDGE = 2;
|
||||
@@ -275,6 +276,39 @@ function handleFrame(buffer) {
|
||||
break;
|
||||
}
|
||||
|
||||
case SERVER_PASTE: {
|
||||
const session = sessions.get(sessionId);
|
||||
|
||||
if (!session || payload.length < 1) {
|
||||
break;
|
||||
}
|
||||
|
||||
const execute = payload[0] !== 0;
|
||||
const text = new TextDecoder().decode(payload.subarray(1));
|
||||
|
||||
/*
|
||||
term.paste rather than term.input, and that is the whole reason this frame exists rather than
|
||||
the host writing the bytes into the pump. paste() wraps the text in bracketed-paste markers
|
||||
when the remote has turned that mode on — xterm tracks \e[?2004h from the output stream, which
|
||||
is something only this page sees — and a shell that receives a multi-line command inside those
|
||||
markers treats every newline as text. Without them it treats each one as "run this", so a
|
||||
three-line snippet runs three commands the moment it is inserted.
|
||||
*/
|
||||
session.term.paste(text);
|
||||
|
||||
/*
|
||||
And the Enter goes through input(), deliberately outside that wrapper. A '\r' appended to the
|
||||
pasted text would be bracketed along with it and arrive at the shell as a literal carriage
|
||||
return, so nothing would run — which is the failure that looks like the feature working right
|
||||
up until somebody wonders why RUN does not.
|
||||
*/
|
||||
if (execute) {
|
||||
session.term.input('\r');
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case SERVER_SESSION_CLOSED: {
|
||||
const session = sessions.get(sessionId);
|
||||
const reason = new TextDecoder().decode(payload);
|
||||
|
||||
Reference in New Issue
Block a user