aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_insert.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/i_insert.go')
-rw-r--r--src/i_insert.go29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/i_insert.go b/src/i_insert.go
index 80f4236..f1838d5 100644
--- a/src/i_insert.go
+++ b/src/i_insert.go
@@ -547,10 +547,31 @@ func i_draw_insert_rdp(ui HardUI, line int, win Quad, in *HostNode) int {
return line
}
-func i_draw_insert_os(ui HardUI, line int, win Quad, in *HostNode) int {
- return 0
+func i_draw_insert_cmd(ui HardUI, line int, win Quad, in *HostNode) int {
+ red := false
+ if win.T + line >= win.B { return line }
+ text := "---- Settings ----"
+ i_draw_text(ui.s, ui.dim[W] / 2 - len(text) / 2, win.T + line, win.R - 1,
+ win.T + line, ui.style[DEF_STYLE], text)
+ if line += 2; win.T + line >= win.B { return line }
+ i_draw_text_box(ui, win.T + line, win, "Command", in.Host,
+ INS_CMD_CMD, false)
+ if line += 1; win.T + line >= win.B { return line }
+ if shell := in.Shell[0]; len(shell) > 0 {
+ if shell[0] == '~' {
+ home, _ := os.UserHomeDir()
+ shell = home + shell[1:]
+ }
+ if stat, err := os.Stat(shell);
+ err != nil || stat.IsDir() == true {
+ red = true
+ }
+ }
+ i_draw_text_box(ui, win.T + line, win, "Shell", in.Shell[0],
+ INS_CMD_SHELL, red);
+ return line
}
-func i_draw_insert_cmd(ui HardUI, line int, win Quad, in *HostNode) int {
- return 0
+func i_draw_insert_os(ui HardUI, line int, win Quad, in *HostNode) int {
+ return line
}