sedwards2009 / extraterm

The swiss army chainsaw of terminal emulators
https://extraterm.org
MIT License
2.51k stars 116 forks source link

Line wrapping doesn't work correctly with windows sessions #353

Open lheinold opened 3 years ago

lheinold commented 3 years ago

When running Extraterm with a windows session type (tested with cmd.exe, powershell.exe and bash.exe from git bash), line wraps have an embedded line break that causes Extraterm to mark the line as "unwrapped". This causes the line break to be included when copy/pasting wrapped lines. I tested with a WSL instance and line wrapping works as expected.

Placing a breakpoint in WindowsConsolePty.ts here:

    this.realPty.on("data", (data: any): void => {
      this._onDataEventEmitter.fire(data);
      this.permittedDataSize(this._permittedDataSize - data.length);
    });

showed that the data variable already included linebreaks. A breakpoint in the corresponding location in ProxyPty.ts did not show the same behavior.

This doesn't happen with the regular windows powershell so I don't think it's just expected behavior.

sedwards2009 commented 2 years ago

I strongly suspect this is a short coming of the underlying windows console system. I'm not sure if there is much I can do about except hope that Microsoft improve it. The Windows Terminal team will probably be the ones to have this sorted out first.