mathworks / mathworks/MATLAB-extension-for-vscode

Printing a table with many columns wraps the lines, making it hard to read

Open
#292 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
435
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
If we print a table with many columns on the terminal, the line wrapping makes it very hard to read. Pressing alt + z (workbench.action.terminal.sizetoContentWidth) and printing the table again fixes the issue. But ideally we shouldn't need to press this keyboard shortcut and print the table again: it would be good if the width of the terminal expanded to fit the size of the table automatically.

To Reproduce
Steps to reproduce the behavior:

tb = table();
for i = 1:40
    tb.("column" + i) = rand(5,1);
end

Type tb in the terminal.
See that the lines wrap around:

Image

Expected behavior
I expected the terminal width to automatically increase so that it fits the whole table:

Image

Useful Information
MATLAB Version: '24.2.0.2740171 (R2024b) Update 1'
VS Code Version: 1.85.2 (system setup)
Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681
Date: 2024-01-18T06:40:10.514Z
Electron: 25.9.7
ElectronBuildId: 26354273
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045
Extension Version: 1.3.6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the 40-column MATLAB table in the terminal, then start at the referenced workbench.action.terminal.sizetoContentWidth implementation in src/vs/workbench/contrib/terminal/browser/terminalInstance.ts. Trace how terminal sizing is triggered and determine what behavior must change so the table fits without pressing Alt+Z or printing it again; verify the reproduction afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab, typescript, vscode
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.