question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSH terminal line wraps after 80 characters

See original GitHub issue

Details

  • Browser and browser version: Chrome 65, FF 52.6 and Safari
  • OS version: windows 7, win 8.1 and High Sierra
  • xterm.js version: 2.4

Steps to reproduce

  1. SSH to a target
  2. Type until it wraps

Our config:

new Terminal({
    cols: 120,
})

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
justinjocewiczcommented, Apr 24, 2018

Easy peasy. Thanks so much!

0reactions
DasyDongcommented, Nov 10, 2020

One import things is that do not define cols and rows with new Terminal(cols: cols, rows: rows), not work for me

Auto fit the term size by windows width , the issue is fixed , share the codes

        let height = document.body.clientHeight;
        let width = document.body.clientWidth;
        let rows = parseInt(height/18, 10);//18是字体高度,根据需要自己修改
        let cols = parseInt(width/9, 10);
        let term = new Terminal();
        term.open(document.getElementById("terminal"));
        term.write("connecting to pod " + pod + "...")

        conn = new WebSocket(url);
        term.on('data', function (data) {
            msg = {operation: "stdin", data: data}
            conn.send(JSON.stringify(msg))
        });

        term.on('resize', function (size) {
            msg = {operation: "resize", cols: size.cols, rows: size.rows};
            conn.send(JSON.stringify(msg))
        });

        conn.onopen = function (e) {
            term.write("\r");
            msg = {operation: "stdin", data: "export TERM=xterm && clear \r"}
            conn.send(JSON.stringify(msg))
            term.resize(cols, rows)
            // term.clear()
        };
Read more comments on GitHub >

github_iconTop Results From Across the Web

Command wraps around same line after 80 characters
A SSH connection to the same machine works just fine. After 80th characters ssh go to the next line. This is the stty...
Read more >
Stop emacs from wrapping 80 column lines in ... - Stack Overflow
Yes, I want the 80th character to be displayed in the 80th column of my terminal. I'll settle for the combination of truncate-mode,...
Read more >
Improper line wrapping at command prompt - Experts Exchange
Windows XP desktop, putty SSH client, linux server. ... That's 62 characters of an 80 character wide terminal. As I continue typing, I...
Read more >
Cygwin bash prompt is wrapping lines on the same line
Judging by -WINCH , this signals the bash process that the terminal window was resized. So this should be done after each terminal...
Read more >
How do I get long command lines to wrap to the next line?
Make sure all non-printable bytes in your PS1 are contained within \[ \] . Otherwise, bash will count them in the length of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found