Fix browser terminal paste for hosting clients.
Deploy Ladill Hosting / deploy (push) Successful in 42s

Use bracketed paste, reliably bind paste capture, stop blocking mousedown focus, and give shells a short prompt with horizontal-scroll readline so long pasted commands do not wrap incorrectly.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-13 18:02:02 +00:00
co-authored by Cursor
parent 335c0fea61
commit a3ba2ac45b
3 changed files with 55 additions and 7 deletions
@@ -183,6 +183,14 @@ class RunHostingTerminalWorkerCommand extends Command
? $homeDirectory
: $homeDirectory.$relativePath;
// Short \W prompt + bracketed paste keep long pasted commands readable in
// the narrow browser terminal used by all hosting clients.
$inputrc = implode("\n", [
'set enable-bracketed-paste on',
'set horizontal-scroll-mode on',
'set blink-matching-paren on',
]);
return implode('; ', [
'export HOME='.escapeshellarg($homeDirectory),
'export USER='.escapeshellarg($account->username),
@@ -192,7 +200,9 @@ class RunHostingTerminalWorkerCommand extends Command
'export COLORTERM=truecolor',
'export COLUMNS='.(int) $cols,
'export LINES='.(int) $rows,
'export PS1='.escapeshellarg($account->username.'@ladill:\w\$ '),
'export PS1='.escapeshellarg($account->username.'@ladill:\W\$ '),
'printf %s '.escapeshellarg($inputrc).' > /tmp/ladill-term-inputrc-$$',
'export INPUTRC=/tmp/ladill-term-inputrc-$$',
'cd '.escapeshellarg($workingDirectory).' 2>/dev/null || cd '.escapeshellarg($homeDirectory),
'stty rows '.(int) $rows.' cols '.(int) $cols.' echo 2>/dev/null || true',
'exec /bin/bash --noprofile --norc -i',