Skip to content
Merged
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
23 changes: 21 additions & 2 deletions exec/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ func executeRemoteCommand(ctx context.Context, params remoteCommandParameters) e
var sizeQueue remotecommand.TerminalSizeQueue
if tty.Raw {
// this call spawns a goroutine to monitor/update the terminal size
sizeQueue = tty.MonitorSize(tty.GetSize())
sizeQueue = &terminalSizeQueueWrapper{
tsq: tty.MonitorSize(tty.GetSize()),
}

// unset stderr if it was previously set because both stdout
// and stderr go over params.stdout when tty is
Expand Down Expand Up @@ -205,7 +207,6 @@ func executeRemoteCommand(ctx context.Context, params remoteCommandParameters) e
Tty: params.tty,
TerminalSizeQueue: sizeQueue,
})

}
return tty.Safe(fn)
}
Expand All @@ -227,3 +228,21 @@ func replicaCommand(buildType appBuildType, command []string) []string {
return command
}
}

// terminalSizeQueueWrapper implements the [remotecommand.TerminalSizeQueue] interface.
type terminalSizeQueueWrapper struct {
tsq term.TerminalSizeQueue
}

// Next returns the new terminal size after the terminal has been resized. It returns nil when
// monitoring has been stopped.
func (t *terminalSizeQueueWrapper) Next() *remotecommand.TerminalSize {
size := t.tsq.Next()
if size == nil {
return nil
}
return &remotecommand.TerminalSize{
Width: size.Width,
Height: size.Height,
}
}
1 change: 0 additions & 1 deletion get/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func (proj *projectCmd) Run(ctx context.Context, client *api.Client, get *Cmd) e
if err != nil {
return err
}

if len(projectList) == 0 {
return get.printEmptyMessage(management.ProjectKind, "")
}
Expand Down
8 changes: 1 addition & 7 deletions get/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,13 @@ dev <none>
projects: test.Projects(organization, "dev", "staging"),
name: "dev",
outputFormat: yamlOut,
output: "apiVersion: management.nine.ch/v1alpha1\nkind: Project\nmetadata:\n name: dev\n namespace: evilcorp\nspec:\n isNonProduction: false\nstatus:\n atProvider: {}\n",
output: "metadata:\n name: dev\n namespace: evilcorp\nspec:\n isNonProduction: false\nstatus:\n atProvider: {}\n",
},
"specific project requested, json output": {
projects: test.Projects(organization, "dev", "staging"),
name: "dev",
outputFormat: jsonOut,
output: `{
"kind": "Project",
"apiVersion": "management.nine.ch/v1alpha1",
"metadata": {
"name": "dev",
"namespace": "evilcorp"
Expand All @@ -110,8 +108,6 @@ dev <none>
outputFormat: jsonOut,
output: `[
{
"kind": "Project",
"apiVersion": "management.nine.ch/v1alpha1",
"metadata": {
"name": "dev",
"namespace": "evilcorp"
Expand All @@ -124,8 +120,6 @@ dev <none>
}
},
{
"kind": "Project",
"apiVersion": "management.nine.ch/v1alpha1",
"metadata": {
"name": "staging",
"namespace": "evilcorp"
Expand Down
Loading