File tree Expand file tree Collapse file tree 4 files changed +47
-8
lines changed
testdata/format/claude/auto-accept-edits Expand file tree Collapse file tree 4 files changed +47
-8
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,21 @@ func removeClaudeMessageBox(msg string) string {
21
21
}
22
22
}
23
23
24
- if strings .HasPrefix (trimmedLastLine (), "? for shortcuts" ) {
25
- popLine ()
26
- }
27
- msgBoxEdge := "───────────────"
28
- if strings .Contains (trimmedLastLine (), msgBoxEdge ) {
29
- popLine ()
24
+ // The ">" symbol is often used to indicate the user input line.
25
+ // We remove all lines including and after the last ">" symbol
26
+ // in the message.
27
+ greaterThanLineIdx := - 1
28
+ for i := len (lines ) - 1 ; i >= max (len (lines )- 6 , 0 ); i -- {
29
+ if strings .Contains (lines [i ], ">" ) {
30
+ greaterThanLineIdx = i
31
+ break
32
+ }
30
33
}
31
- if strings . Contains ( trimmedLastLine (), ">" ) {
32
- popLine ()
34
+ if greaterThanLineIdx >= 0 {
35
+ lines = lines [: greaterThanLineIdx ]
33
36
}
37
+
38
+ msgBoxEdge := "───────────────"
34
39
if strings .Contains (trimmedLastLine (), msgBoxEdge ) {
35
40
popLine ()
36
41
}
Original file line number Diff line number Diff line change
1
+ ╭────────────────────────────────────────────╮
2
+ │ ✻ Welcome to Claude Code research preview! │
3
+ │ │
4
+ │ /help for help │
5
+ │ │
6
+ │ cwd: /Users/hugodutka/dev/agentapi │
7
+ ╰────────────────────────────────────────────╯
8
+
9
+ Tips for getting started:
10
+
11
+ 1. Run /init to create a CLAUDE.md file with instructions for Claude
12
+ 2. Run /terminal-setup to set up terminal integration
13
+ 3. Use Claude to help with file analysis, editing, bash commands and git
14
+ 4. Be as specific as you would with another engineer for the best results
Original file line number Diff line number Diff line change
1
+ ╭────────────────────────────────────────────╮
2
+ │ ✻ Welcome to Claude Code research preview! │
3
+ │ │
4
+ │ /help for help │
5
+ │ │
6
+ │ cwd: /Users/hugodutka/dev/agentapi │
7
+ ╰────────────────────────────────────────────╯
8
+
9
+ Tips for getting started:
10
+
11
+ 1. Run /init to create a CLAUDE.md file with instructions for Claude
12
+ 2. Run /terminal-setup to set up terminal integration
13
+ 3. Use Claude to help with file analysis, editing, bash commands and git
14
+ 4. Be as specific as you would with another engineer for the best results
15
+
16
+ ╭──────────────────────────────────────────────────────────────────────────────╮
17
+ │ > │
18
+ ╰──────────────────────────────────────────────────────────────────────────────╯
19
+ ⏵⏵ auto-accept edits on (shift+tab to ✓ Update installed • Restart to
20
+ toggle) apply
You can’t perform that action at this time.
0 commit comments