mirror of
https://github.com/db9979/sshtermy.git
synced 2026-12-06 12:44:08 +01:00
Verbindungs-Manager mit verschlüsseltem Store (AES-256-GCM, Argon2id, DPAPI), SSH-Terminal (x/vt), Tunnel -L/-R/-D und Web-Services, KI-Copilot für OpenAI-kompatible Endpunkte (Ghost-Text, Folgebefehle, Ziel-Modus, Frage) mit festen Gefahrenregeln, Versionierung und signiertes Auto-Update. Idee: Dominik Bornhäußer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUgYsYk78PSL5QZPeim
26 lines
618 B
Go
26 lines
618 B
Go
package termemu
|
|
|
|
import (
|
|
"io"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestTypedInputAndGhost(t *testing.T) {
|
|
tm := New(60, 5, io.Discard)
|
|
defer tm.Close()
|
|
tm.Write([]byte("\x1b[1;32mdominik@spark\x1b[0m:~$ docker p"))
|
|
typed, ok := tm.TypedInput()
|
|
if !ok || typed != "docker p" {
|
|
t.Fatalf("TypedInput = %q %v", typed, ok)
|
|
}
|
|
v := tm.View("s -a", func(s string) string { return "[" + s + "]" })
|
|
if !strings.Contains(v, "docker p[s -a]") {
|
|
t.Fatalf("Ghost fehlt: %q", strings.Split(v, "\n")[0])
|
|
}
|
|
tm.Write([]byte("\r\nzeile 2\r\n"))
|
|
if !strings.Contains(tm.PlainLines(10), "zeile 2") {
|
|
t.Fatal("PlainLines")
|
|
}
|
|
}
|