mirror of
https://github.com/db9979/sshtermy.git
synced 2026-12-05 12:24:08 +01:00
* Gefahrenregeln: alle Regelgruppen, zeilenweise, Lücken als root; Agent: root/Admin fragt, Standard Vorsichtig Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm * Team-Abo: Schutz bleibt, Tunnel ohne Autostart, geänderte Runbooks/Schnellbefehle erst ansehen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm * Dialoge von selbst: eine Sekunde Tastensperre, warten statt ersetzen; MCP-Gefahr j zweimal Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm * Zeitpläne: neue Hosts erst nach Bestätigung, Änderndes nicht stundenlang nachholen, Team-Runbooks erst ansehen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm * Switch-Shell: keine Tasten während sshTermy tippt, Esc bricht ab, Syslog-Einrichtung verwirft bei Fehler, nicht im Konfigurationsmodus Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm * Broadcast und Zeitpläne: Probelauf auf einem Host, Stopp nach 3 Fehlern Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm * trzsz: Dateien vom Server erst nach Rückfrage, nie überschreiben Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm * Geheimnisse lesen fragt nach: Agent, Plan-Erkundung, MCP (auch sudo) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm * Doku: README DE/EN, Webseite, Kurzreferenz und Hilfe zu den Sicherungen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm * CI: Relay-Tests loggen nach Testende nicht mehr (Race), PowerShell erkennt offene Eingabe zusätzlich am Fehlercode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUjLxnD1qZgVKVc7UFm --------- Co-authored-by: Claude <noreply@anthropic.com>
33 lines
853 B
Go
33 lines
853 B
Go
package ui
|
|
|
|
import (
|
|
"testing"
|
|
|
|
tea "charm.land/bubbletea/v2"
|
|
)
|
|
|
|
func TestShellLock(t *testing.T) {
|
|
if !configPrompt("sw-buero(config)#") || !configPrompt("[edit]") || configPrompt("sw-buero#") {
|
|
t.Fatal("configPrompt")
|
|
}
|
|
if cliError([]string{"Invalid input: configure"}) == "" || cliError([]string{"logging 10.0.0.1 udp 5514"}) != "" {
|
|
t.Fatal("cliError")
|
|
}
|
|
a := newPaletteTestApp(t)
|
|
s := &session{}
|
|
if a.shellBusyKey(s, tea.KeyPressMsg{Code: 'n', Text: "n"}) {
|
|
t.Fatal("ohne laufende Folge gesperrt")
|
|
}
|
|
s.cap.hold()
|
|
if !a.shellBusyKey(s, tea.KeyPressMsg{Code: 'n', Text: "n"}) {
|
|
t.Fatal("Taste während sshTermy tippt nicht abgefangen")
|
|
}
|
|
if !a.shellBusyKey(s, tea.KeyPressMsg{Code: tea.KeyEscape}) || !s.cap.aborted() {
|
|
t.Fatal("Esc bricht nicht ab")
|
|
}
|
|
s.cap.release()
|
|
if s.cap.active() {
|
|
t.Fatal("bleibt gesperrt")
|
|
}
|
|
}
|