Skip to content

xterm5.3.0 replaces the first character of a line when the input character is too long 当输入字符过长时候会他替换行首字符 #4892

Answered by yanceysong
yanceysong asked this question in Q&A
Discussion options

You must be logged in to vote

这个问题我解决了,是因为jsch开启Linux终端的时候有限制,导致前端在超过80字符的时候,Linux会给一个换行和空字符串。解决办法是在开启终端以后执行stty cols 240,或者channel进行设置
((ChannelShell) channel).setPtyType("xterm");
((ChannelShell) channel).setPtySize(5000, 5000, 640, 480); // 设置列数为 5000

I solved this problem because jsch had a restriction when opening the Linux terminal, which caused the front-end to give a newline and an empty string when it exceeded 80 characters. The workaround is to run stty cols 240 after opening the terminal, or set the channel ((ChannelShell) channel).setPtyType("xterm");
((ChannelShell) channel).setPtySize(5000, 5000, 640, 480); // Set the number of columns to 5000

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@yanceysong
Comment options

Answer selected by yanceysong
Comment options

You must be logged in to vote
3 replies
@yanceysong
Comment options

@MrLeungE1
Comment options

@carolin-violet
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #4890 on November 22, 2023 11:06.