diff options
author | Joe <rbo@gmx.us> | 2024-04-16 20:20:20 +0200 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-04-16 20:20:20 +0200 |
commit | 8ec7d12ba76a8db0a82a0cda5c7598f1bf711edc (patch) | |
tree | 590d3118298e63576ad542a6d47fa731554cbf51 /src/i_insert.go | |
parent | lookin good (diff) | |
download | hardflip-8ec7d12ba76a8db0a82a0cda5c7598f1bf711edc.tar.gz hardflip-8ec7d12ba76a8db0a82a0cda5c7598f1bf711edc.tar.bz2 hardflip-8ec7d12ba76a8db0a82a0cda5c7598f1bf711edc.tar.xz hardflip-8ec7d12ba76a8db0a82a0cda5c7598f1bf711edc.tar.zst hardflip-8ec7d12ba76a8db0a82a0cda5c7598f1bf711edc.zip |
qwe
Diffstat (limited to '')
-rw-r--r-- | src/i_insert.go | 29 |
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 } |