Skip to content

Commit

Permalink
Revert "Merge pull request #2882 from ActiveState/mitchell/dx-2214-2"
Browse files Browse the repository at this point in the history
This reverts commit 137a5d7, reversing
changes made to 94b8811.
  • Loading branch information
mitchell-as committed Feb 6, 2024
1 parent 6fac623 commit 08b0619
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 182 deletions.
7 changes: 0 additions & 7 deletions cmd/state/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,6 @@ func run(args []string, isInteractive bool, cfg *config.Instance, out output.Out

// Set up conditional, which accesses a lot of primer data
sshell := subshell.New(cfg)
if isInteractive {
// Disable terminal echo while State Tool is running.
// Other than in prompts and subshells (which temporarily re-enable echo), user typing should
// not interfere with output (e.g. runtime progress bars).
sshell.TurnOffEcho()
defer sshell.TurnOnEcho()
}

conditional := constraints.NewPrimeConditional(auth, pj, sshell.Shell())
project.RegisterConditional(conditional)
Expand Down
2 changes: 0 additions & 2 deletions internal/runbits/activation/activation.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ func ActivateAndWait(
if err := ss.Activate(proj, cfg, out); err != nil {
return locale.WrapError(err, "error_could_not_activate_subshell", "Could not activate a new subshell.")
}
ss.TurnOnEcho() // temporarily re-enable echo while the subshell is active
defer ss.TurnOffEcho()

a, err := process.NewActivation(cfg, os.Getpid())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/runbits/runtime/progress/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"sync"
"time"

"github.com/ActiveState/cli/internal/multilog"
"github.com/go-openapi/strfmt"
"github.com/vbauerster/mpb/v7"
"golang.org/x/net/context"

"github.com/ActiveState/cli/internal/errs"
"github.com/ActiveState/cli/internal/locale"
"github.com/ActiveState/cli/internal/logging"
"github.com/ActiveState/cli/internal/multilog"
"github.com/ActiveState/cli/internal/output"
"github.com/ActiveState/cli/pkg/platform/runtime/artifact"
"github.com/ActiveState/cli/pkg/platform/runtime/setup/events"
Expand Down
15 changes: 0 additions & 15 deletions internal/subshell/bash/bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/ActiveState/cli/internal/osutils/user"
"github.com/ActiveState/cli/internal/output"
"github.com/ActiveState/cli/internal/subshell/sscommon"
"github.com/ActiveState/cli/internal/subshell/termecho"
"github.com/ActiveState/cli/pkg/project"
)

Expand Down Expand Up @@ -220,17 +219,3 @@ func (v *SubShell) IsAvailable() bool {
}
return fileutils.FileExists(rcFile)
}

func (v *SubShell) TurnOffEcho() {
if runtime.GOOS == "windows" {
return // not supported
}
termecho.Off()
}

func (v *SubShell) TurnOnEcho() {
if runtime.GOOS == "windows" {
return // not supported
}
termecho.On()
}
9 changes: 0 additions & 9 deletions internal/subshell/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/ActiveState/cli/internal/osutils"
"github.com/ActiveState/cli/internal/output"
"github.com/ActiveState/cli/internal/subshell/sscommon"
"github.com/ActiveState/cli/internal/subshell/termecho"
"github.com/ActiveState/cli/pkg/project"
)

Expand Down Expand Up @@ -204,11 +203,3 @@ func (v *SubShell) IsActive() bool {
func (v *SubShell) IsAvailable() bool {
return runtime.GOOS == "windows"
}

func (v *SubShell) TurnOffEcho() {
termecho.Off()
}

func (v *SubShell) TurnOnEcho() {
termecho.On()
}
16 changes: 0 additions & 16 deletions internal/subshell/fish/fish.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"

"github.com/ActiveState/cli/internal/constants"
"github.com/ActiveState/cli/internal/errs"
Expand All @@ -15,7 +14,6 @@ import (
"github.com/ActiveState/cli/internal/osutils/user"
"github.com/ActiveState/cli/internal/output"
"github.com/ActiveState/cli/internal/subshell/sscommon"
"github.com/ActiveState/cli/internal/subshell/termecho"
"github.com/ActiveState/cli/pkg/project"
)

Expand Down Expand Up @@ -197,17 +195,3 @@ func (v *SubShell) IsAvailable() bool {
}
return fileutils.FileExists(rcFile)
}

func (v *SubShell) TurnOffEcho() {
if runtime.GOOS == "windows" {
return // not supported
}
termecho.Off()
}

func (v *SubShell) TurnOnEcho() {
if runtime.GOOS == "windows" {
return // not supported
}
termecho.On()
}
6 changes: 0 additions & 6 deletions internal/subshell/subshell.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ type SubShell interface {

// IsAvailable returns whether the shell is available on the system
IsAvailable() bool

// TurnOffEcho turns off input echoing.
TurnOffEcho()

// TurnOnEcho turns on input echoing.
TurnOnEcho()
}

// New returns the subshell relevant to the current process, but does not activate it
Expand Down
16 changes: 0 additions & 16 deletions internal/subshell/tcsh/tcsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"

"github.com/ActiveState/cli/internal/errs"
"github.com/ActiveState/cli/internal/fileutils"
Expand All @@ -14,7 +13,6 @@ import (
"github.com/ActiveState/cli/internal/osutils/user"
"github.com/ActiveState/cli/internal/output"
"github.com/ActiveState/cli/internal/subshell/sscommon"
"github.com/ActiveState/cli/internal/subshell/termecho"
"github.com/ActiveState/cli/pkg/project"
)

Expand Down Expand Up @@ -191,17 +189,3 @@ func (v *SubShell) IsAvailable() bool {
}
return fileutils.FileExists(rcFile)
}

func (v *SubShell) TurnOffEcho() {
if runtime.GOOS == "windows" {
return // not supported
}
termecho.Off()
}

func (v *SubShell) TurnOnEcho() {
if runtime.GOOS == "windows" {
return // not supported
}
termecho.On()
}
20 changes: 0 additions & 20 deletions internal/subshell/termecho/termecho.go

This file was deleted.

6 changes: 0 additions & 6 deletions internal/subshell/termecho/termecho_darwin.go

This file was deleted.

6 changes: 0 additions & 6 deletions internal/subshell/termecho/termecho_linux.go

This file was deleted.

32 changes: 0 additions & 32 deletions internal/subshell/termecho/termecho_unix.go

This file was deleted.

30 changes: 0 additions & 30 deletions internal/subshell/termecho/termecho_windows.go

This file was deleted.

16 changes: 0 additions & 16 deletions internal/subshell/zsh/zsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"

"github.com/ActiveState/cli/internal/constants"
Expand All @@ -19,7 +18,6 @@ import (
"github.com/ActiveState/cli/internal/osutils/user"
"github.com/ActiveState/cli/internal/output"
"github.com/ActiveState/cli/internal/subshell/sscommon"
"github.com/ActiveState/cli/internal/subshell/termecho"
"github.com/ActiveState/cli/pkg/project"
)

Expand Down Expand Up @@ -241,17 +239,3 @@ func (v *SubShell) IsAvailable() bool {
}
return fileutils.FileExists(rcFile)
}

func (v *SubShell) TurnOffEcho() {
if runtime.GOOS == "windows" {
return // not supported
}
termecho.Off()
}

func (v *SubShell) TurnOnEcho() {
if runtime.GOOS == "windows" {
return // not supported
}
termecho.On()
}

0 comments on commit 08b0619

Please sign in to comment.