Skip to content

Commit

Permalink
Set Guardian TTY window size to 500x500
Browse files Browse the repository at this point in the history
#1841

Signed-off-by: Joris Melchior <jmelchior@pivotal.io>
  • Loading branch information
mhuangpivotal authored and jmelchio committed Mar 6, 2018
1 parent e64f467 commit 783033f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion exec/task_action.go
Expand Up @@ -238,7 +238,10 @@ func (action *TaskAction) Run(
Args: config.Run.Args,

Dir: path.Join(action.artifactsRoot, config.Run.Dir),
TTY: &garden.TTYSpec{},

// Guardian sets the default TTY window size to width: 80, height: 24,
// which creates ANSI control sequences that do not work with other window sizes
TTY: &garden.TTYSpec{WindowSize: &garden.WindowSize{Columns: 500, Rows: 500}},
}, processIO)
}
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions exec/task_action_test.go
Expand Up @@ -474,7 +474,7 @@ var _ = Describe("TaskAction", func() {
Expect(spec.Args).To(Equal([]string{"some", "args"}))
Expect(spec.Dir).To(Equal("some-artifact-root"))
Expect(spec.User).To(BeEmpty())
Expect(spec.TTY).To(Equal(&garden.TTYSpec{}))
Expect(spec.TTY).To(Equal(&garden.TTYSpec{WindowSize: &garden.WindowSize{Columns: 500, Rows: 500}}))
})

It("directs the process's stdout/stderr to the io config", func() {
Expand Down Expand Up @@ -505,7 +505,7 @@ var _ = Describe("TaskAction", func() {
Path: "ls",
Args: []string{"some", "args"},
Dir: "some-artifact-root",
TTY: &garden.TTYSpec{},
TTY: &garden.TTYSpec{WindowSize: &garden.WindowSize{Columns: 500, Rows: 500}},
}))
})
})
Expand Down

0 comments on commit 783033f

Please sign in to comment.