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

imx8plus: The /etc/profile.d/resize.sh messes up Bash commands over SSH #8

Open
mirzaCet opened this issue Apr 12, 2023 · 0 comments
Open

Comments

@mirzaCet
Copy link

mirzaCet commented Apr 12, 2023

Our build and deployment system execute Bash commands remotely over SSH on the imx8plus system.
The resize command sets the terminal size for the current session, which includes the number of rows and columns that are displayed in the terminal window. The problem is that, perhaps, our commands can exceed the terminal size, so they wrap up in new line, and consequently break our pipeline / commands. In effect, some weird characters are printed out on standard output and the session breaks without further explanation. I haven't dug much deeper into it, but the problem is there, and the resize is the cause.

One solution would be to skip the resize for SSH sessions.

if [ -z "$SSH_CLIENT" ] && [ -z "$SSH_TTY" ]; then
    # We're not running over SSH connection, i.e. in a local terminal, so run the resize command
    shopt -s checkwinsize
    command -v resize &>/dev/null && resize
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant