Enha: shell mode in filepickerdir
This commit is contained in:
@@ -474,6 +474,7 @@ func executeCommandAndDisplay(cmdText string) {
|
|||||||
}
|
}
|
||||||
// Create the command execution
|
// Create the command execution
|
||||||
cmd := exec.Command(command, args...)
|
cmd := exec.Command(command, args...)
|
||||||
|
cmd.Dir = cfg.FilePickerDir
|
||||||
// Execute the command and get output
|
// Execute the command and get output
|
||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
// Add the command being executed to the chat
|
// Add the command being executed to the chat
|
||||||
|
|||||||
1
tools.go
1
tools.go
@@ -714,6 +714,7 @@ func executeCommand(args map[string]string) []byte {
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
cmd := exec.CommandContext(ctx, command, cmdArgs...)
|
cmd := exec.CommandContext(ctx, command, cmdArgs...)
|
||||||
|
cmd.Dir = cfg.FilePickerDir
|
||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
msg := fmt.Sprintf("command '%s' failed; error: %v; output: %s", command, err, string(output))
|
msg := fmt.Sprintf("command '%s' failed; error: %v; output: %s", command, err, string(output))
|
||||||
|
|||||||
Reference in New Issue
Block a user