Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

CLI client for [osfci.tech](https://osfci.tech), HPE's remote OpenBMC development platform (part of the [Open System Firmware CI](https://github.com/opencomputeproject/OSF-OSFCI) project). Allocate physical HPE ProLiant Gen11 servers, flash firmware, access serial consoles, and control power — all from the terminal.

> **Note**: Microsoft Windows support requires a build from source process.

## Install

```bash
Expand Down Expand Up @@ -198,7 +200,7 @@ curl -sk -u root:0penBmc \

The CLI communicates with the OSFCI gateway at `osfci.tech`:

```
```text
osfci-cli --(HTTPS)--> osfci.tech gateway --(HTTP)--> controller node
| |
| reverse proxy (port 443) | EM100 emulators
Expand Down
4 changes: 0 additions & 4 deletions internal/console/bmcweb.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ func (s *BMCWebSession) Run() error {
s.oldState = oldState
defer s.restore()

sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGWINCH)
defer signal.Stop(sigCh)

intCh := make(chan os.Signal, 1)
signal.Notify(intCh, syscall.SIGINT, syscall.SIGTERM)
defer signal.Stop(intCh)
Expand Down
17 changes: 17 additions & 0 deletions internal/console/resize_signal_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//go:build !windows

package console

import (
"os"
"os/signal"
"syscall"
)

func notifyResizeSignal(ch chan<- os.Signal) {
signal.Notify(ch, syscall.SIGWINCH)
}

func isResizeSignal(sig os.Signal) bool {
return sig == syscall.SIGWINCH
}
14 changes: 14 additions & 0 deletions internal/console/resize_signal_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//go:build windows

package console

import "os"

func notifyResizeSignal(ch chan<- os.Signal) {
_ = ch
}

func isResizeSignal(sig os.Signal) bool {
_ = sig
return false
}
6 changes: 3 additions & 3 deletions internal/console/ttyd.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ func (s *Session) Run() error {
s.oldState = oldState
defer s.restore()

// Handle SIGWINCH for terminal resize.
// Handle terminal resize signal where supported.
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGWINCH)
notifyResizeSignal(sigCh)
defer signal.Stop(sigCh)

// Handle SIGINT/SIGTERM gracefully.
Expand Down Expand Up @@ -164,7 +164,7 @@ func (s *Session) Run() error {
for {
select {
case sig := <-sigCh:
if sig == syscall.SIGWINCH {
if isResizeSignal(sig) {
s.sendResize()
}
case <-intCh:
Expand Down