aboutsummaryrefslogtreecommitdiffstats
path: root/src/c_exec.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/c_exec.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/c_exec.go b/src/c_exec.go
index e00fe36..f6d84ed 100644
--- a/src/c_exec.go
+++ b/src/c_exec.go
@@ -211,12 +211,14 @@ func c_format_cmd(host *HostNode, opts HardOpts,
return nil, nil
}
if len(gpg) > 0 && gpg != "plain" && len(host.Pass) > 0 {
- i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, " GnuPG ")
- text := "decryption using gpg..."
- left, right := i_left_right(len(text), *ui)
- i_draw_text(ui.s, left, ui.dim[H] - 3, right, ui.dim[H] - 3,
- ui.style[DEF_STYLE], text)
- ui.s.Show()
+ if ui.s != nil {
+ i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, " GnuPG ")
+ text := "decryption using gpg..."
+ left, right := i_left_right(len(text), *ui)
+ i_draw_text(ui.s, left, ui.dim[H] - 3, right, ui.dim[H] - 3,
+ ui.style[DEF_STYLE], text)
+ ui.s.Show()
+ }
var err error
pass, err = c_decrypt_str(host.Pass)
if err != nil {
@@ -292,12 +294,13 @@ func c_exec(host *HostNode, opts HardOpts, ui *HardUI) {
if host.Protocol == PROTOCOL_CMD {
silent = host.Silent
}
- if silent == false {
+ if silent == false && ui.s != nil {
if err := ui.s.Suspend(); err != nil {
c_error_mode("screen", err, ui)
return
}
- } else {
+ } else if ui.s != nil {
+
i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, " Exec ")
text := "running command..."
left, right := i_left_right(len(text), *ui)
@@ -312,7 +315,7 @@ func c_exec(host *HostNode, opts HardOpts, ui *HardUI) {
if opts.Loop == false {
ui.s.Fini()
os.Exit(0)
- } else if silent == false {
+ } else if silent == false && ui.s != nil {
c_resume_or_die(ui)
}
}