Skip to content

Commit

Permalink
enable zmodem and drag file even if trzsz is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnywong committed Feb 3, 2024
1 parent 5b03991 commit b021858
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tssh/trzsz.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ func enableTrzsz(args *sshArgs, ss *sshSession) error {
return nil
}

disableTrzsz := strings.ToLower(getExOptionConfig(args, "EnableTrzsz")) == "no"
enableZmodem := args.Zmodem || strings.ToLower(getExOptionConfig(args, "EnableZmodem")) == "yes"
enableDragFile := args.DragFile || strings.ToLower(getExOptionConfig(args, "EnableDragFile")) == "yes"

// disable trzsz ( trz / tsz )
if strings.ToLower(getExOptionConfig(args, "EnableTrzsz")) == "no" {
if disableTrzsz && !enableZmodem && !enableDragFile {
wrapStdIO(ss.serverIn, ss.serverOut, ss.serverErr, ss.tty)
onTerminalResize(func(width, height int) { _ = ss.session.WindowChange(height, width) })
return nil
Expand Down Expand Up @@ -146,9 +150,9 @@ func enableTrzsz(args *sshArgs, ss *sshSession) error {
// os.Stderr └────────┘ stderr └────────┘
trzszFilter := trzsz.NewTrzszFilter(os.Stdin, os.Stdout, ss.serverIn, ss.serverOut, trzsz.TrzszOptions{
TerminalColumns: int32(width),
DetectDragFile: args.DragFile || strings.ToLower(getExOptionConfig(args, "EnableDragFile")) == "yes",
DetectDragFile: enableDragFile,
DetectTraceLog: args.TraceLog,
EnableZmodem: args.Zmodem || strings.ToLower(getExOptionConfig(args, "EnableZmodem")) == "yes",
EnableZmodem: enableZmodem,
})

// reset terminal size on resize
Expand Down

0 comments on commit b021858

Please sign in to comment.