Steer on enter, queue on shift+enter Steering is the common case — a reader typing while the model works usually wants it read now, not after the thing they are trying to redirect has finished — so it is the unmodified key. Shift+enter asks for the other one. The terminal has to be willing to tell them apart. Shift+enter arrives as the same carriage return as enter unless the keyboard protocol is on, so the interface turns on flag 1, disambiguate escape codes, and turns it off on the way out: a terminal still reporting this after the session has gone is one the next program has to cope with. Ordinary text is unaffected — only keys that were already ambiguous change shape — and a terminal that ignores the request leaves enter doing the default, which is the one worth having. Enter is then `\x1b[13u` with a modifier parameter, where 2 is shift. Terminals that do not speak the protocol but send escape-then-return for shift or alt enter are read as the deliberate key too: an escape with a return immediately behind it is not something anyone types by accident. That check has to come before the bare escape is taken as an interrupt, or the escape half of it stops the turn the reader was steering. The hint bar says which key does which while a turn runs, because a promise the reader cannot see is one they will not use. 398 tests pass, including that enter and both spellings of shift+enter reach the session as the modes they claim.
Steer on enter, queue on shift+enter
Deploy story
What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.
Not deployed through the forge lane
No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.
Changed files
-
modified
packages/openagents-cli/src/coder-session.ts -
modified
packages/openagents-cli/src/coder-ui.ts -
modified
packages/openagents-cli/test/coder-ui.test.ts
Diff
3 files changed, +106 -10
packages/openagents-cli/src/coder-session.ts modified +6 -5
@@ -461,7 +461,7 @@ export class CoderSession {
| 461 | 461 |
|
| 462 | 462 |
|
| 463 | 463 |
|
| 464 |
|
|
| 464 |
|
|
| 465 | 465 |
|
| 466 | 466 |
|
| 467 | 467 |
|
@@ -518,10 +518,11 @@ export class CoderSession {
| 518 | 518 |
|
| 519 | 519 |
|
| 520 | 520 |
|
| 521 |
|
|
| 522 |
|
|
| 523 |
|
|
| 524 |
|
|
| 521 |
|
|
| 522 |
|
|
| 523 |
|
|
| 524 |
|
|
| 525 |
|
|
| 525 | 526 |
|
| 526 | 527 |
|
| 527 | 528 |
|
packages/openagents-cli/src/coder-ui.ts modified +42 -5
@@ -46,6 +46,18 @@ const ERASE_LINE = "\x1b[K";
| 46 | 46 |
|
| 47 | 47 |
|
| 48 | 48 |
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
|
|
| 56 |
|
|
| 57 |
|
|
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 49 | 61 |
|
| 50 | 62 |
|
| 51 | 63 |
|
@@ -295,7 +307,7 @@ export function runCoderUi(session: CoderSession, options: CoderUiOptions): Prom
| 295 | 307 |
|
| 296 | 308 |
|
| 297 | 309 |
|
| 298 |
|
|
| 310 |
|
|
| 299 | 311 |
|
| 300 | 312 |
|
| 301 | 313 |
|
@@ -595,7 +607,11 @@ export function runCoderUi(session: CoderSession, options: CoderUiOptions): Prom
| 595 | 607 |
|
| 596 | 608 |
|
| 597 | 609 |
|
| 598 |
|
|
| 610 |
|
|
| 611 |
|
|
| 612 |
|
|
| 613 |
|
|
| 614 |
|
|
| 599 | 615 |
|
| 600 | 616 |
|
| 601 | 617 |
|
@@ -661,7 +677,7 @@ export function runCoderUi(session: CoderSession, options: CoderUiOptions): Prom
| 661 | 677 |
|
| 662 | 678 |
|
| 663 | 679 |
|
| 664 |
|
|
| 680 |
|
|
| 665 | 681 |
|
| 666 | 682 |
|
| 667 | 683 |
|
@@ -715,7 +731,7 @@ export function runCoderUi(session: CoderSession, options: CoderUiOptions): Prom
| 715 | 731 |
|
| 716 | 732 |
|
| 717 | 733 |
|
| 718 |
|
|
| 734 |
|
|
| 719 | 735 |
|
| 720 | 736 |
|
| 721 | 737 |
|
@@ -828,11 +844,32 @@ export function runCoderUi(session: CoderSession, options: CoderUiOptions): Prom
| 828 | 844 |
|
| 829 | 845 |
|
| 830 | 846 |
|
| 847 |
|
|
| 848 |
|
|
| 849 |
|
|
| 850 |
|
|
| 851 |
|
|
| 852 |
|
|
| 853 |
|
|
| 854 |
|
|
| 855 |
|
|
| 856 |
|
|
| 831 | 857 |
|
| 832 | 858 |
|
| 833 | 859 |
|
| 834 | 860 |
|
| 835 | 861 |
|
| 862 |
|
|
| 863 |
|
|
| 864 |
|
|
| 865 |
|
|
| 866 |
|
|
| 867 |
|
|
| 868 |
|
|
| 869 |
|
|
| 870 |
|
|
| 871 |
|
|
| 872 |
|
|
| 836 | 873 |
|
| 837 | 874 |
|
| 838 | 875 |
|
@@ -956,7 +993,7 @@ export function runCoderUi(session: CoderSession, options: CoderUiOptions): Prom
| 956 | 993 |
|
| 957 | 994 |
|
| 958 | 995 |
|
| 959 |
|
|
| 996 |
|
|
| 960 | 997 |
|
| 961 | 998 |
|
| 962 | 999 |
|
packages/openagents-cli/test/coder-ui.test.ts modified +58
@@ -656,6 +656,64 @@ describe("typing while a turn is running", () => {
| 656 | 656 |
|
| 657 | 657 |
|
| 658 | 658 |
|
| 659 |
|
|
| 660 |
|
|
| 661 |
|
|
| 662 |
|
|
| 663 |
|
|
| 664 |
|
|
| 665 |
|
|
| 666 |
|
|
| 667 |
|
|
| 668 |
|
|
| 669 |
|
|
| 670 |
|
|
| 671 |
|
|
| 672 |
|
|
| 673 |
|
|
| 674 |
|
|
| 675 |
|
|
| 676 |
|
|
| 677 |
|
|
| 678 |
|
|
| 679 |
|
|
| 680 |
|
|
| 681 |
|
|
| 682 |
|
|
| 683 |
|
|
| 684 |
|
|
| 685 |
|
|
| 686 |
|
|
| 687 |
|
|
| 688 |
|
|
| 689 |
|
|
| 690 |
|
|
| 691 |
|
|
| 692 |
|
|
| 693 |
|
|
| 694 |
|
|
| 695 |
|
|
| 696 |
|
|
| 697 |
|
|
| 698 |
|
|
| 699 |
|
|
| 700 |
|
|
| 701 |
|
|
| 702 |
|
|
| 703 |
|
|
| 704 |
|
|
| 705 |
|
|
| 706 |
|
|
| 707 |
|
|
| 708 |
|
|
| 709 |
|
|
| 710 |
|
|
| 711 |
|
|
| 712 |
|
|
| 713 |
|
|
| 714 |
|
|
| 715 |
|
|
| 716 |
|
|
| 659 | 717 |
|
| 660 | 718 |
|
| 661 | 719 |
|