diff --git a/cli/context_command.go b/cli/context_command.go index b424e82b..a0d1645c 100644 --- a/cli/context_command.go +++ b/cli/context_command.go @@ -19,6 +19,7 @@ import ( "fmt" "os" "os/exec" + "os/user" "sort" "strings" "text/template" @@ -454,6 +455,14 @@ func (c *ctxCommand) showCommand(_ *fisk.ParseContext) error { if strings.HasPrefix(file, "op://") { return color.CyanString("1Password") } + if file[0] == '~' { + usr, err := user.Current() + if err != nil { + return color.RedString("ERROR") + } + file = strings.Replace(file, "~", usr.HomeDir, 1) + } + ok, err := fileAccessible(file) if !ok || err != nil { c.validateErrors++