mirror of
https://github.com/jixishi/SerialTerminalForWindowsTerminal.git
synced 2026-06-16 00:52:44 +00:00
refactor: extract internal/session and eliminate I/O globals
Move serial port, trzsz filter, and pipe lifecycle into internal/session.SerialSession. Replace 8 global I/O vars (serialPort, trzszFilter, stdinPipe, stdoutPipe, clientIn, clientOut, termch, termchOnce) with single sess variable. Delete utils.go. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/trzsz/trzsz-go/trzsz"
|
||||
"go.bug.st/serial"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/jixishi/SerialTerminalForWindowsTerminal/internal/session"
|
||||
)
|
||||
|
||||
var (
|
||||
serialPort serial.Port
|
||||
out io.Writer = os.Stdout
|
||||
trzszFilter *trzsz.TrzszFilter
|
||||
clientIn *io.PipeReader
|
||||
stdoutPipe *io.PipeReader
|
||||
stdinPipe *io.PipeWriter
|
||||
clientOut *io.PipeWriter
|
||||
sess *session.SerialSession
|
||||
out io.Writer = os.Stdout
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user