Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devlib/utils/ssh.py: Fix set terminal window size #259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions devlib/utils/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,15 @@ def ssh_get_shell(host, username, password=None, keyfile=None, port=None, timeou
raise TargetError(message.format(host))
time.sleep(5)

conn.sendline('shopt -s checkwinsize')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we hit similar issue I had a look at this PR, and shopt is a bash-specific builtin, which does not exist in the busybox shell AFAIK (or even zsh, which uses set for similar purposes). I don't think that bash feature has equivalent in all shells, so it should probably not be relied on.

conn.prompt()
conn.setwinsize(500,200)
conn.sendline('')
conn.prompt()
conn.sendline('stty rows 500')
conn.prompt()
conn.sendline('stty cols 200')
conn.prompt()
conn.setecho(False)
return conn

Expand Down