mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-22 02:04:22 +01:00
chore: rename bash -> shell
This commit is contained in:
@@ -80,7 +80,7 @@ type AgentSelectedMsg struct {
|
|||||||
type SessionClearedMsg struct{}
|
type SessionClearedMsg struct{}
|
||||||
type CompactSessionMsg struct{}
|
type CompactSessionMsg struct{}
|
||||||
type SendPrompt = Prompt
|
type SendPrompt = Prompt
|
||||||
type SendBash = struct {
|
type SendShell = struct {
|
||||||
Command string
|
Command string
|
||||||
}
|
}
|
||||||
type SetEditorContentMsg struct {
|
type SetEditorContentMsg struct {
|
||||||
@@ -755,7 +755,7 @@ func (a *App) SendPrompt(ctx context.Context, prompt Prompt) (*App, tea.Cmd) {
|
|||||||
return a, tea.Batch(cmds...)
|
return a, tea.Batch(cmds...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) SendBash(ctx context.Context, command string) (*App, tea.Cmd) {
|
func (a *App) SendShell(ctx context.Context, command string) (*App, tea.Cmd) {
|
||||||
var cmds []tea.Cmd
|
var cmds []tea.Cmd
|
||||||
if a.Session.ID == "" {
|
if a.Session.ID == "" {
|
||||||
session, err := a.CreateSession(ctx)
|
session, err := a.CreateSession(ctx)
|
||||||
@@ -776,8 +776,8 @@ func (a *App) SendBash(ctx context.Context, command string) (*App, tea.Cmd) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("Failed to submit bash command", "error", err)
|
slog.Error("Failed to submit shell command", "error", err)
|
||||||
return toast.NewErrorToast("Failed to submit bash command")()
|
return toast.NewErrorToast("Failed to submit shell command")()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ func (m *editorComponent) SubmitBash() (tea.Model, tea.Cmd) {
|
|||||||
updated, cmd := m.Clear()
|
updated, cmd := m.Clear()
|
||||||
m = updated.(*editorComponent)
|
m = updated.(*editorComponent)
|
||||||
cmds = append(cmds, cmd)
|
cmds = append(cmds, cmd)
|
||||||
cmds = append(cmds, util.CmdHandler(app.SendBash{Command: command}))
|
cmds = append(cmds, util.CmdHandler(app.SendShell{Command: command}))
|
||||||
return m, tea.Batch(cmds...)
|
return m, tea.Batch(cmds...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -687,6 +687,8 @@ func renderToolDetails(
|
|||||||
|
|
||||||
func renderToolName(name string) string {
|
func renderToolName(name string) string {
|
||||||
switch name {
|
switch name {
|
||||||
|
case "bash":
|
||||||
|
return "Shell"
|
||||||
case "webfetch":
|
case "webfetch":
|
||||||
return "Fetch"
|
return "Fetch"
|
||||||
case "invalid":
|
case "invalid":
|
||||||
|
|||||||
@@ -402,8 +402,8 @@ func (a Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
a.showCompletionDialog = false
|
a.showCompletionDialog = false
|
||||||
a.app, cmd = a.app.SendPrompt(context.Background(), msg)
|
a.app, cmd = a.app.SendPrompt(context.Background(), msg)
|
||||||
cmds = append(cmds, cmd)
|
cmds = append(cmds, cmd)
|
||||||
case app.SendBash:
|
case app.SendShell:
|
||||||
a.app, cmd = a.app.SendBash(context.Background(), msg.Command)
|
a.app, cmd = a.app.SendShell(context.Background(), msg.Command)
|
||||||
cmds = append(cmds, cmd)
|
cmds = append(cmds, cmd)
|
||||||
case app.SetEditorContentMsg:
|
case app.SetEditorContentMsg:
|
||||||
// Set the editor content without sending
|
// Set the editor content without sending
|
||||||
|
|||||||
Reference in New Issue
Block a user