SSH to Linux host with an incompatible Terminal Size












0















I use SSH from MacOS within its built-in Terminal program to login to a CentOS server. For some reasons, after login, this server has some setting that makes it 80 column only. If my Terminal is wider than 80 columns, strange things will happen. Like if I type a bunch of characters, the strings will break at the 80 col mark and then resume on the first character of the same line.



I researched on this issue and the best I can come up with is using xterm escape sequence:



echo -e "e[8;30;90t";


Which resizes my Terminal to 30x90. I change my terminal size frequently and I don't want to keep track of my current terminal size. I also don't want my terminal to resize.



Is there a better way to fix that?










share|improve this question























  • This seems crazy but common. It is usually caused by the Terminal connection type that can be adjusted in macOS. Open up Terminal, go to “Preferences” and then—in whatever profile you are in—go to the “Advanced” tab and under “Terminfo” change the value of “Declare terminal as:” to something other than what it is set to. In macOS Mojave I have: xterm-256color. So try something like just plain xterm or even vt102. Look at this answer as well.

    – JakeGould
    Jan 26 at 0:53


















0















I use SSH from MacOS within its built-in Terminal program to login to a CentOS server. For some reasons, after login, this server has some setting that makes it 80 column only. If my Terminal is wider than 80 columns, strange things will happen. Like if I type a bunch of characters, the strings will break at the 80 col mark and then resume on the first character of the same line.



I researched on this issue and the best I can come up with is using xterm escape sequence:



echo -e "e[8;30;90t";


Which resizes my Terminal to 30x90. I change my terminal size frequently and I don't want to keep track of my current terminal size. I also don't want my terminal to resize.



Is there a better way to fix that?










share|improve this question























  • This seems crazy but common. It is usually caused by the Terminal connection type that can be adjusted in macOS. Open up Terminal, go to “Preferences” and then—in whatever profile you are in—go to the “Advanced” tab and under “Terminfo” change the value of “Declare terminal as:” to something other than what it is set to. In macOS Mojave I have: xterm-256color. So try something like just plain xterm or even vt102. Look at this answer as well.

    – JakeGould
    Jan 26 at 0:53
















0












0








0








I use SSH from MacOS within its built-in Terminal program to login to a CentOS server. For some reasons, after login, this server has some setting that makes it 80 column only. If my Terminal is wider than 80 columns, strange things will happen. Like if I type a bunch of characters, the strings will break at the 80 col mark and then resume on the first character of the same line.



I researched on this issue and the best I can come up with is using xterm escape sequence:



echo -e "e[8;30;90t";


Which resizes my Terminal to 30x90. I change my terminal size frequently and I don't want to keep track of my current terminal size. I also don't want my terminal to resize.



Is there a better way to fix that?










share|improve this question














I use SSH from MacOS within its built-in Terminal program to login to a CentOS server. For some reasons, after login, this server has some setting that makes it 80 column only. If my Terminal is wider than 80 columns, strange things will happen. Like if I type a bunch of characters, the strings will break at the 80 col mark and then resume on the first character of the same line.



I researched on this issue and the best I can come up with is using xterm escape sequence:



echo -e "e[8;30;90t";


Which resizes my Terminal to 30x90. I change my terminal size frequently and I don't want to keep track of my current terminal size. I also don't want my terminal to resize.



Is there a better way to fix that?







linux ssh xterm






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 26 at 0:24









some usersome user

1,17231126




1,17231126













  • This seems crazy but common. It is usually caused by the Terminal connection type that can be adjusted in macOS. Open up Terminal, go to “Preferences” and then—in whatever profile you are in—go to the “Advanced” tab and under “Terminfo” change the value of “Declare terminal as:” to something other than what it is set to. In macOS Mojave I have: xterm-256color. So try something like just plain xterm or even vt102. Look at this answer as well.

    – JakeGould
    Jan 26 at 0:53





















  • This seems crazy but common. It is usually caused by the Terminal connection type that can be adjusted in macOS. Open up Terminal, go to “Preferences” and then—in whatever profile you are in—go to the “Advanced” tab and under “Terminfo” change the value of “Declare terminal as:” to something other than what it is set to. In macOS Mojave I have: xterm-256color. So try something like just plain xterm or even vt102. Look at this answer as well.

    – JakeGould
    Jan 26 at 0:53



















This seems crazy but common. It is usually caused by the Terminal connection type that can be adjusted in macOS. Open up Terminal, go to “Preferences” and then—in whatever profile you are in—go to the “Advanced” tab and under “Terminfo” change the value of “Declare terminal as:” to something other than what it is set to. In macOS Mojave I have: xterm-256color. So try something like just plain xterm or even vt102. Look at this answer as well.

– JakeGould
Jan 26 at 0:53







This seems crazy but common. It is usually caused by the Terminal connection type that can be adjusted in macOS. Open up Terminal, go to “Preferences” and then—in whatever profile you are in—go to the “Advanced” tab and under “Terminfo” change the value of “Declare terminal as:” to something other than what it is set to. In macOS Mojave I have: xterm-256color. So try something like just plain xterm or even vt102. Look at this answer as well.

– JakeGould
Jan 26 at 0:53












1 Answer
1






active

oldest

votes


















0














Try typing



reset


after launching the terminal (maybe add to your .bashrc file). This should clear the screen and reset the terminal size information used by the shell to something appropriate.






share|improve this answer


























  • That didn't work. I suspect resize will work but there is no resize on that host.

    – some user
    Jan 26 at 6:12











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1398612%2fssh-to-linux-host-with-an-incompatible-terminal-size%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Try typing



reset


after launching the terminal (maybe add to your .bashrc file). This should clear the screen and reset the terminal size information used by the shell to something appropriate.






share|improve this answer


























  • That didn't work. I suspect resize will work but there is no resize on that host.

    – some user
    Jan 26 at 6:12
















0














Try typing



reset


after launching the terminal (maybe add to your .bashrc file). This should clear the screen and reset the terminal size information used by the shell to something appropriate.






share|improve this answer


























  • That didn't work. I suspect resize will work but there is no resize on that host.

    – some user
    Jan 26 at 6:12














0












0








0







Try typing



reset


after launching the terminal (maybe add to your .bashrc file). This should clear the screen and reset the terminal size information used by the shell to something appropriate.






share|improve this answer















Try typing



reset


after launching the terminal (maybe add to your .bashrc file). This should clear the screen and reset the terminal size information used by the shell to something appropriate.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 26 at 0:54









JakeGould

31.4k1096138




31.4k1096138










answered Jan 26 at 0:31









davidgodavidgo

43.9k75291




43.9k75291













  • That didn't work. I suspect resize will work but there is no resize on that host.

    – some user
    Jan 26 at 6:12



















  • That didn't work. I suspect resize will work but there is no resize on that host.

    – some user
    Jan 26 at 6:12

















That didn't work. I suspect resize will work but there is no resize on that host.

– some user
Jan 26 at 6:12





That didn't work. I suspect resize will work but there is no resize on that host.

– some user
Jan 26 at 6:12


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1398612%2fssh-to-linux-host-with-an-incompatible-terminal-size%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Probability when a professor distributes a quiz and homework assignment to a class of n students.

Aardman Animations

Are they similar matrix