diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3ba481..1b157e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,8 @@ jobs: - run: go vet ./... && go test ./... - name: Cross-Compile run: | - for t in windows/arm64 windows/386 windows/amd64 darwin/arm64 darwin/amd64 linux/amd64; do - CGO_ENABLED=0 GOOS=${t%/*} GOARCH=${t#*/} go build -o /dev/null ./cmd/sshtermy + for t in windows/arm64 windows/386 windows/amd64 darwin/arm64 darwin/amd64 linux/amd64 linux/arm64 linux/arm linux/riscv64; do + CGO_ENABLED=0 GOARM=7 GOOS=${t%/*} GOARCH=${t#*/} go build -o /dev/null ./cmd/sshtermy done packaging: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52b85a6..5118bb5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,23 +48,25 @@ jobs: go run ./tools/changelog -out internal/changelog/CHANGELOG.md -notes notes.md head -20 internal/changelog/CHANGELOG.md - - name: Bauen (windows arm64/386/amd64, darwin arm64/amd64, linux amd64/arm64) + - name: Bauen (windows arm64/386/amd64, darwin arm64/amd64, linux amd64/arm64/arm/riscv64) env: UPDATE_PUBKEY: ${{ vars.UPDATE_PUBKEY }} run: | PKG=github.com/db9979/sshtermy/internal/version LDF="-s -w -X $PKG.Version=${{ steps.v.outputs.version }} -X $PKG.Commit=${GITHUB_SHA::7} -X $PKG.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ) -X $PKG.UpdatePubKey=$UPDATE_PUBKEY" mkdir -p dist - for t in windows/arm64 windows/386 windows/amd64 darwin/arm64 darwin/amd64 linux/amd64 linux/arm64; do + for t in windows/arm64 windows/386 windows/amd64 darwin/arm64 darwin/amd64 linux/amd64 linux/arm64 linux/arm linux/riscv64; do os=${t%/*}; arch=${t#*/}; ext=""; [ "$os" = windows ] && ext=".exe" - CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -trimpath -ldflags "$LDF" -o "dist/sshtermy_${os}_${arch}${ext}" ./cmd/sshtermy + # linux/arm = 32-Bit-ARMv7 (Raspberry Pi OS armhf, z. B. uConsole mit CM3/CM4) + CGO_ENABLED=0 GOARM=7 GOOS=$os GOARCH=$arch go build -trimpath -ldflags "$LDF" -o "dist/sshtermy_${os}_${arch}${ext}" ./cmd/sshtermy done cd dist && sha256sum sshtermy_* > checksums.txt && cat checksums.txt - - name: Debian-Pakete (amd64, arm64) + - name: Debian-Pakete (amd64, arm64, armhf, riscv64) run: | - for a in amd64 arm64; do - packaging/deb.sh ${{ steps.v.outputs.version }} $a dist/sshtermy_linux_$a dist + for a in amd64 arm64 armhf riscv64; do + b=$a; [ $a = armhf ] && b=arm + packaging/deb.sh ${{ steps.v.outputs.version }} $a dist/sshtermy_linux_$b dist done cd dist && sha256sum sshtermy_* > checksums.txt && cat checksums.txt diff --git a/Makefile b/Makefile index 67926e6..856c0b2 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo none) DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ) PKG := github.com/db9979/sshtermy/internal/version LDFLAGS := -s -w -X $(PKG).Version=$(VERSION) -X $(PKG).Commit=$(COMMIT) -X $(PKG).Date=$(DATE) -X $(PKG).UpdatePubKey=$(UPDATE_PUBKEY) -TARGETS := windows/arm64 windows/386 windows/amd64 darwin/arm64 darwin/amd64 linux/amd64 linux/arm64 +TARGETS := windows/arm64 windows/386 windows/amd64 darwin/arm64 darwin/amd64 linux/amd64 linux/arm64 linux/arm linux/riscv64 .PHONY: build test dist clean run build: @@ -18,7 +18,7 @@ dist: test @for t in $(TARGETS); do \ os=$${t%/*}; arch=$${t#*/}; ext=""; [ $$os = windows ] && ext=".exe"; \ echo "-> $$os/$$arch"; \ - CGO_ENABLED=0 GOOS=$$os GOARCH=$$arch go build -trimpath -ldflags "$(LDFLAGS)" -o dist/sshtermy_$${os}_$${arch}$$ext ./cmd/sshtermy || exit 1; \ + CGO_ENABLED=0 GOARM=7 GOOS=$$os GOARCH=$$arch go build -trimpath -ldflags "$(LDFLAGS)" -o dist/sshtermy_$${os}_$${arch}$$ext ./cmd/sshtermy || exit 1; \ done cd dist && sha256sum sshtermy_* > checksums.txt diff --git a/README.de.md b/README.de.md index 514a53f..c943db9 100644 --- a/README.de.md +++ b/README.de.md @@ -82,7 +82,7 @@ winget install db9979.sshTermy # Windows (soba brew tap db9979/sshtermy https://github.com/db9979/sshtermy # macOS und Linux brew install sshtermy echo "deb [trusted=yes] https://db9979.github.io/sshtermy/apt ./" | sudo tee /etc/apt/sources.list.d/sshtermy.list -sudo apt update && sudo apt install sshtermy # Debian, Ubuntu (amd64, arm64) +sudo apt update && sudo apt install sshtermy # Debian, Ubuntu, Raspberry Pi OS (amd64, arm64, armhf, riscv64) ``` Über Homebrew oder apt installiert, tauscht sshTermy sich nicht selbst aus, sondern zeigt den Update-Befehl. @@ -95,7 +95,7 @@ Oder lade die passende Datei aus den [Releases](https://github.com/db9979/sshter | Windows x86 32 Bit | `sshtermy_windows_386.exe` | | Windows x64 | `sshtermy_windows_amd64.exe` | | macOS Apple Silicon / Intel | `sshtermy_darwin_arm64` / `sshtermy_darwin_amd64` | -| Linux | `sshtermy_linux_amd64` / `sshtermy_linux_arm64` | +| Linux | `sshtermy_linux_amd64` / `sshtermy_linux_arm64` / `sshtermy_linux_arm` (32 Bit ARMv7) / `sshtermy_linux_riscv64` | **macOS (und Linux): eine Zeile im Terminal** installiert die neueste Version, prüft die Prüfsumme und legt `~/Applications/sshTermy.app` an (Doppelklick oder Spotlight „sshTermy“ öffnet sie im Terminal, bzw. in iTerm, @@ -111,6 +111,14 @@ sshtermy_darwin_arm64`, dann im Terminal mit `./sshtermy_darwin_arm64` starten. Empfohlen unter Windows: **Windows Terminal** (Truecolor, F-Tasten, Unicode). +**ClockworkPi uConsole** (und ähnliche Handhelds): apt und der Einzeiler wählen für jeden Kern das passende Programm +(CM4/CM5 und A-06 mit 64-Bit-System: arm64, 32-Bit-Raspberry-Pi-OS: armhf, R-01: riscv64). Der 5"-Bildschirm reicht: +Mit gut lesbarer Schrift passen etwa 80×22 bis 106×30 Zeichen, sshTermy ist ab 80×24 ausgelegt; darunter lassen +Kopfzeile und Hilfe Details weg, statt Text abzuschneiden. Die Tastatur hat keine F-Reihe: +**Fn+1 … Fn+0 = F1 … F10, Fn+- = F11, Fn+= = F12**. Für ⇧F1 … ⇧F10 *zuerst* Shift halten, dann Fn und die Ziffer. +Alles steht auch in der Befehlspalette (**Strg+Leertaste**), mit dem Trackball lassen sich Tasten und Hinweise +anklicken, und im Manager mit `b` jede Taste umlegen. + ``` sshtermy # starten sshtermy --version # Version, Commit, Build-Datum diff --git a/README.md b/README.md index b87bb70..ad42efa 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ winget install db9979.sshTermy # Windows (once brew tap db9979/sshtermy https://github.com/db9979/sshtermy # macOS and Linux brew install sshtermy echo "deb [trusted=yes] https://db9979.github.io/sshtermy/apt ./" | sudo tee /etc/apt/sources.list.d/sshtermy.list -sudo apt update && sudo apt install sshtermy # Debian, Ubuntu (amd64, arm64) +sudo apt update && sudo apt install sshtermy # Debian, Ubuntu, Raspberry Pi OS (amd64, arm64, armhf, riscv64) ``` Installed via Homebrew or apt, sshTermy does not replace itself but shows the update command instead. @@ -95,7 +95,7 @@ Or download the matching file from the [Releases](https://github.com/db9979/ssht | Windows x86 32 bit | `sshtermy_windows_386.exe` | | Windows x64 | `sshtermy_windows_amd64.exe` | | macOS Apple Silicon / Intel | `sshtermy_darwin_arm64` / `sshtermy_darwin_amd64` | -| Linux | `sshtermy_linux_amd64` / `sshtermy_linux_arm64` | +| Linux | `sshtermy_linux_amd64` / `sshtermy_linux_arm64` / `sshtermy_linux_arm` (32 bit ARMv7) / `sshtermy_linux_riscv64` | **macOS (and Linux): one line in Terminal** installs the latest version, checks its checksum and creates `~/Applications/sshTermy.app` (double-click or Spotlight "sshTermy" opens it in Terminal, or iTerm if installed) @@ -111,6 +111,14 @@ sshtermy_darwin_arm64`, then start it from Terminal with `./sshtermy_darwin_arm6 Recommended on Windows: **Windows Terminal** (truecolor, function keys, Unicode). +**ClockworkPi uConsole** (and similar handhelds): apt or the one-line installer pick the right build for every core +(CM4/CM5 and A-06 with a 64 bit system: arm64, 32 bit Raspberry Pi OS: armhf, R-01: riscv64). The 5" screen is big +enough: with a readable font you get about 80×22 to 106×30 characters, and sshTermy is laid out for 80×24 and up; +below that, the header and help drop details instead of cutting text. The keyboard has no function row: +**Fn+1 … Fn+0 = F1 … F10, Fn+- = F11, Fn+= = F12**. For ⇧F1 … ⇧F10 hold Shift *first*, then Fn and the digit. +Everything is also in the command palette (**Ctrl+Space**), the trackball clicks keys and hints, and keys can be +changed in the manager with `b`. + ``` sshtermy # start sshtermy --version # version, commit, build date diff --git a/install.sh b/install.sh index fdf6c79..bca3e86 100755 --- a/install.sh +++ b/install.sh @@ -25,6 +25,8 @@ esac case "$(uname -m)" in arm64 | aarch64) arch=arm64 ;; x86_64 | amd64) arch=amd64 ;; +armv7* | armv8l | armhf) arch=arm ;; # 32-Bit-System, z. B. Raspberry Pi OS armhf +riscv64) arch=riscv64 ;; *) die "Prozessor $(uname -m) wird nicht unterstützt" ;; esac # Rosetta: ein x86-Terminal auf Apple Silicon meldet x86_64. diff --git a/internal/ui/help.go b/internal/ui/help.go index 1c566fa..51dfd63 100644 --- a/internal/ui/help.go +++ b/internal/ui/help.go @@ -383,7 +383,14 @@ func (m *modal) helpView(s Styles, w, h int) string { // Höhe begrenzen: Fensterrand (2), Rahmen und Abstand (4), Warnung und // Hinweis mit Leerzeile davor, Tastenzeile mit Leerzeile davor. bodyLines := strings.Split(body, "\n") + foot := "\n\n" + warn + "\n" + note maxBody := max(3, h-2-4-(1+lipgloss.Height(warn)+lipgloss.Height(note))-2) + if maxBody < 10 { + // wenige Zeilen (z. B. uConsole mit großer Schrift): Warnung und + // Hinweis blättern mit, damit mehr Platz für die Tasten bleibt + bodyLines = append(bodyLines, strings.Split(foot[1:], "\n")...) + foot, maxBody = "", max(3, h-2-4-2) + } keys := [][2]string{{"Esc", i18n.T("schließen")}} info := "" if total := len(bodyLines); total > maxBody { @@ -397,7 +404,7 @@ func (m *modal) helpView(s Styles, w, h int) string { m.scroll = 0 } return s.dialog(dialog{icon: "?", title: i18n.T("Tastenkürzel"), sub: version.Short(), - body: strings.Join(bodyLines, "\n") + "\n\n" + warn + "\n" + note, info: info, keys: keys, width: cw, maxW: 200}, w) + body: strings.Join(bodyLines, "\n") + foot, info: info, keys: keys, width: cw, maxW: 200}, w) } func (m *modal) helpKey(key string) (closeIt bool) { diff --git a/internal/ui/statusline.go b/internal/ui/statusline.go index ff74439..2abdd9e 100644 --- a/internal/ui/statusline.go +++ b/internal/ui/statusline.go @@ -129,15 +129,25 @@ func (a *App) sessionBar(s *session) string { cfg := a.st.LLM() // KI: Punkt = Zustand des Endpunkts (llmhealth.go), Klick = Erklärung h := a.llmHealth() - ai := st.BadgeAI.Render("✦ " + trunc(cfg.Model, 22)) - if t := h.badgeText(); t != "" { - ai = st.BadgeAI.Render("✦ " + trunc(cfg.Model, 22) + " · " + t) + // KI-Anzeige in drei Breiten: Modell + Antwortzeit, nur Antwortzeit, nur Punkt + aiBadge := func(full, short bool) string { + txt := "✦ " + trunc(cfg.Model, 22) + if !full { + txt = "✦" + } + if t := h.badgeText(); t != "" && (full || short) { + txt += " · " + t + } + ai := st.BadgeAI.Render(txt) + if !cfg.SuggestEnabled { + ai = st.Badge.Foreground(st.T.Muted).Render(i18n.T("✦ Ghost aus")) + if !full { + ai = st.Badge.Foreground(st.T.Muted).Render("✦") + } + } + ai = st.Badge.Foreground(a.llmColor(h.level)).PaddingRight(0).Render(h.dot(a.lh.probing)) + ai + return a.z.click(ai, func(tea.Mouse, bool) tea.Cmd { return a.openLLMStatus() }) } - if !cfg.SuggestEnabled { - ai = st.Badge.Foreground(st.T.Muted).Render(i18n.T("✦ Ghost aus")) - } - ai = st.Badge.Foreground(a.llmColor(h.level)).PaddingRight(0).Render(h.dot(a.lh.probing)) + ai - ai = a.z.click(ai, func(tea.Mouse, bool) tea.Cmd { return a.openLLMStatus() }) tun := a.keyZone(a.keys.label(actTunnels), st.Badge.Render("⇄ "+plural(nT, i18n.Pick("Tunnel", "tunnel"), i18n.Pick("Tunnel", "tunnels")))) goal := "" if s.goal.active { @@ -147,12 +157,28 @@ func (a *App) sessionBar(s *session) string { goal = a.z.click(st.Badge.Foreground(st.T.Warn).Render(fmt.Sprintf(i18n.T("⇡ Verlauf −%d · Esc"), s.scroll)), func(tea.Mouse, bool) tea.Cmd { s.scroll, s.sel = 0, nil; return nil }) + " " + goal } - if hb := a.hostBadge(s); hb != "" { - tun = hb + " " + tun - } - right := strings.Join(line, "") + " " + goal + " " + tun + " " + ai - if lw := lipgloss.Width(left.String()); a.w-lw-lipgloss.Width(right) < 24 && len(line) > 0 { - right = goal + " " + tun + " " + ai // schmales Fenster: Leitung weglassen + hb := a.hostBadge(s) + // Schmales Fenster (z. B. uConsole mit großer Schrift): Teile von rechts + // nach Wichtigkeit weglassen statt mitten im Text abzuschneiden. + lw := lipgloss.Width(left.String()) + var right string + for stage := 0; stage <= 5; stage++ { + parts := []string{} + if stage < 1 { + parts = append(parts, strings.Join(line, "")) + } + parts = append(parts, goal) + if hb != "" && stage < 3 { + parts = append(parts, hb) + } + if stage < 4 || nT > 0 { + parts = append(parts, tun) + } + parts = append(parts, aiBadge(stage < 2, stage < 5)) + right = strings.Join(parts, " ") + if a.w-lw-lipgloss.Width(right) >= 24 { + break + } } l := left.String() room := a.w - lipgloss.Width(l) - lipgloss.Width(right) - 3 diff --git a/internal/ui/statusline_test.go b/internal/ui/statusline_test.go new file mode 100644 index 0000000..ef67df2 --- /dev/null +++ b/internal/ui/statusline_test.go @@ -0,0 +1,51 @@ +package ui + +import ( + "strings" + "testing" + + "charm.land/lipgloss/v2" + "github.com/charmbracelet/x/ansi" + + "github.com/db9979/sshtermy/internal/domain" + "github.com/db9979/sshtermy/internal/store" +) + +// Schmale Fenster (uConsole mit großer Schrift): Die Kopfzeile lässt Teile +// weg, statt den KI-Modellnamen mitten im Wort abzuschneiden. +func TestSessionBarNarrow(t *testing.T) { + t.Setenv("SSHTERMY_HOME", t.TempDir()) + st, err := store.Open() + if err != nil { + t.Fatal(err) + } + if err := st.Init([]byte("correct horse"), false); err != nil { + t.Fatal(err) + } + a, err := New(st) + if err != nil { + t.Fatal(err) + } + s := &session{id: 1, conn: domain.Connection{Alias: "web-01", Host: "10.0.0.1", Port: 22, Username: "dominik"}, chipArmed: -1} + model := a.st.LLM().Model + if model == "" { + t.Skip("kein Standardmodell") + } + for _, w := range []int{140, 100, 80, 64, 50} { + a.w = w + bar := ansi.Strip(a.sessionBar(s)) + if lipgloss.Width(bar) > w { + t.Errorf("w=%d: Kopfzeile %d breit", w, lipgloss.Width(bar)) + } + if !strings.Contains(bar, "✦") { + t.Errorf("w=%d: KI-Anzeige fehlt: %q", w, bar) + } + if strings.Contains(bar, model[:3]) && !strings.Contains(bar, trunc(model, 22)) { + t.Errorf("w=%d: Modellname abgeschnitten: %q", w, bar) + } + } + a.w = 140 + if bar := ansi.Strip(a.sessionBar(s)); !strings.Contains(bar, trunc(model, 22)) { + t.Errorf("breit: Modellname fehlt: %q", bar) + } +} diff --git a/packaging/check.sh b/packaging/check.sh index 08b910e..312d291 100755 --- a/packaging/check.sh +++ b/packaging/check.sh @@ -5,7 +5,7 @@ set -eu t="$(mktemp -d)" trap 'rm -rf "$t"' EXIT INT TERM mkdir -p "$t/dist" -for n in windows_arm64.exe windows_386.exe windows_amd64.exe darwin_arm64 darwin_amd64 linux_amd64 linux_arm64; do +for n in windows_arm64.exe windows_386.exe windows_amd64.exe darwin_arm64 darwin_amd64 linux_amd64 linux_arm64 linux_arm linux_riscv64; do printf '#!/bin/sh\necho "sshTermy v1.0.0"\n' >"$t/dist/sshtermy_$n" done (cd "$t/dist" && sha256sum sshtermy_* >checksums.txt) @@ -13,6 +13,7 @@ done packaging/deb.sh 1.0.0 amd64 "$t/dist/sshtermy_linux_amd64" "$t/apt" >/dev/null dpkg-deb -f "$t/apt/sshtermy_1.0.0_amd64.deb" Package Version Architecture packaging/apt-repo.sh "$t/apt" +packaging/deb.sh 1.0.0 armhf "$t/dist/sshtermy_linux_arm" "$t/apt" >/dev/null grep -q "^Filename: ./sshtermy_1.0.0_amd64.deb" "$t/apt/Packages" packaging/formula.sh 1.0.0 "$t/dist/checksums.txt" >"$t/sshtermy.rb" diff --git a/site/de/index.html b/site/de/index.html index 317a46a..eefa906 100644 --- a/site/de/index.html +++ b/site/de/index.html @@ -63,8 +63,8 @@ brew install sshtermy
curl -fsSL https://raw.githubusercontent.com/db9979/sshtermy/main/install.sh | sh
Debian, Ubuntu, Raspberry Pi OS 64 Bit (apt):
+Debian, Ubuntu, Raspberry Pi OS, ClockworkPi uConsole (apt):
echo "deb [trusted=yes] https://db9979.github.io/sshtermy/apt ./" | sudo tee /etc/apt/sources.list.d/sshtermy.list sudo apt update && sudo apt install sshtermy
Homebrew und der Einzeiler von oben gehen auch unter Linux.
diff --git a/site/index.html b/site/index.html index 46bcb2d..13ff7f9 100644 --- a/site/index.html +++ b/site/index.html @@ -63,8 +63,8 @@ brew install sshtermycurl -fsSL https://raw.githubusercontent.com/db9979/sshtermy/main/install.sh | sh
Debian, Ubuntu, Raspberry Pi OS 64-bit (apt):
+Debian, Ubuntu, Raspberry Pi OS, ClockworkPi uConsole (apt):
echo "deb [trusted=yes] https://db9979.github.io/sshtermy/apt ./" | sudo tee /etc/apt/sources.list.d/sshtermy.list sudo apt update && sudo apt install sshtermy
Homebrew and the one-line installer above work on Linux too.
diff --git a/tools/dev/gifs/prepare.py b/tools/dev/gifs/prepare.py index 247a936..bba5e42 100644 --- a/tools/dev/gifs/prepare.py +++ b/tools/dev/gifs/prepare.py @@ -5,7 +5,7 @@ shutil.rmtree(home, ignore_errors=True) r = Rec(lang, home, "--no-intro") r.wait(2); r.type("demo1234", 0.02); r.k("Tab"); r.type("demo1234", 0.02); r.k("Enter", d=2); r.k("Escape", d=0.8) for alias, host, user, tags in [("web-01", "127.0.0.1", "dominik", "web"), ("db-01", "127.0.0.2", "postgres", "db"), ("spark", "127.0.0.3", "dominik", "lab")]: - r.k("n", d=1); r.type(alias, 0.01); r.k("Tab"); r.type(host, 0.01); r.k("Tab"); r.k("BSpace", "BSpace", d=0.2); r.type("2222", 0.01); r.k("Tab") + r.k("n", d=1); r.type(alias, 0.01); r.k("Tab", "Tab"); r.type(host, 0.01); r.k("Tab"); r.k("BSpace", "BSpace", d=0.2); r.type("2222", 0.01); r.k("Tab") r.type(user, 0.01); r.k("Tab"); r.k("Right", "Right", d=0.3); r.k("Tab"); r.type("secret", 0.01); r.k("Tab", "Tab", d=0.3); r.type(tags, 0.01); r.k("C-s", d=1) print(r.screen()) r.stop = True; import subprocess; subprocess.run(["tmux", "kill-session", "-t", "g"])