patchrelay 0.49.1 → 0.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build-info.json
CHANGED
package/dist/cli/watch/App.js
CHANGED
|
@@ -11,6 +11,7 @@ import { buildWatchDetailExportText, exportWatchTextToTempFile, findLastAssistan
|
|
|
11
11
|
import { measureRenderedTextRows } from "./layout-measure.js";
|
|
12
12
|
import { PROMPT_COMPOSER_HINT, measurePromptComposerRows } from "./prompt-layout.js";
|
|
13
13
|
import { clearTransientStatus, defaultTimerApi, setPersistentStatus, showTransientStatus } from "./transient-status.js";
|
|
14
|
+
import { isPromptBackspaceKey, isPromptDeleteKey } from "./input-keys.js";
|
|
14
15
|
async function postPrompt(baseUrl, issueKey, text, bearerToken) {
|
|
15
16
|
const headers = { "content-type": "application/json" };
|
|
16
17
|
if (bearerToken)
|
|
@@ -285,14 +286,14 @@ export function App({ baseUrl, bearerToken, initialIssueKey }) {
|
|
|
285
286
|
else if (key.downArrow) {
|
|
286
287
|
recallPromptHistory("newer");
|
|
287
288
|
}
|
|
288
|
-
else if (key
|
|
289
|
+
else if (isPromptBackspaceKey(input, key)) {
|
|
289
290
|
if (promptCursor > 0) {
|
|
290
291
|
setPromptBuffer((buffer) => `${buffer.slice(0, promptCursor - 1)}${buffer.slice(promptCursor)}`);
|
|
291
292
|
setPromptCursor((cursor) => Math.max(0, cursor - 1));
|
|
292
293
|
setPromptHistoryIndex(null);
|
|
293
294
|
}
|
|
294
295
|
}
|
|
295
|
-
else if (key
|
|
296
|
+
else if (isPromptDeleteKey(input, key)) {
|
|
296
297
|
if (promptCursor < promptBuffer.length) {
|
|
297
298
|
setPromptBuffer((buffer) => `${buffer.slice(0, promptCursor)}${buffer.slice(promptCursor + 1)}`);
|
|
298
299
|
setPromptHistoryIndex(null);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function isPromptBackspaceKey(input, key) {
|
|
2
|
+
return key.backspace === true
|
|
3
|
+
|| input === "\u0008"
|
|
4
|
+
|| input === "\u007f"
|
|
5
|
+
|| (key.ctrl === true && input === "h");
|
|
6
|
+
}
|
|
7
|
+
export function isPromptDeleteKey(input, key) {
|
|
8
|
+
return key.delete === true || input === "\u001b[3~";
|
|
9
|
+
}
|