You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow using shell aliases in interactive custom commands (jesseduffield#3793)
- **PR Description**
When executing an interactive custom command, use the user's shell
rather than "bash", and pass the -i flag. This makes it possible to use
shell aliases or shell functions which are not available in
non-interactive shells.
In previous attempts to solve this, concerns were brought up: [this
one](jesseduffield#2096 (comment))
is addressed by using the interactive shell only for custom commands but
not anything else. [This
one](jesseduffield#2096 (comment))
is a little dubious and unconfirmed, so I'm not very worried about it.
Supersedes jesseduffield#2096 and jesseduffield#3299. Fixesjesseduffield#770, jesseduffield#899, and jesseduffield#1642.
Copy file name to clipboardExpand all lines: pkg/commands/oscommands/cmd_obj_builder.go
+18-7Lines changed: 18 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ type ICmdObjBuilder interface {
14
14
New(args []string) ICmdObj
15
15
// NewShell takes a string like `git commit` and returns an executable shell command for it e.g. `sh -c 'git commit'`
16
16
NewShell(commandStrstring) ICmdObj
17
+
// Like NewShell, but uses the user's shell rather than "bash", and passes -i to it
18
+
NewInteractiveShell(commandStrstring) ICmdObj
17
19
// Quote wraps a string in quotes with any necessary escaping applied. The reason for bundling this up with the other methods in this interface is that we basically always need to make use of this when creating new command objects.
0 commit comments