Skip to content

Commit 5befc96

Browse files
authored
fix wsh ai arg handling after "-" (for stdin) (#2129)
1 parent e7ecd9e commit 5befc96

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"editor.tabSize": 4,
66
"editor.insertSpaces": false,
77
"prettier.useEditorConfig": true,
8+
"diffEditor.renderSideBySide": false,
89
"[javascript]": {
910
"editor.defaultFormatter": "esbenp.prettier-vscode"
1011
},

cmd/wsh/cmd/wshcmd-ai.go

+8
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ func aiRun(cmd *cobra.Command, args []string) (rtnErr error) {
135135
return fmt.Errorf("reading from stdin: %w", err)
136136
}
137137
message.Write(data)
138+
139+
// Also include any remaining arguments (excluding the "-" itself)
140+
if len(args) > 1 {
141+
if message.Len() > 0 {
142+
message.WriteString(" ")
143+
}
144+
message.WriteString(strings.Join(args[1:], " "))
145+
}
138146
} else {
139147
message.WriteString(strings.Join(args, " "))
140148
}

0 commit comments

Comments
 (0)