diff --git a/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstance.css b/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstance.css index 0de791fc950..e7df2335a9a 100644 --- a/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstance.css +++ b/src/vs/workbench/contrib/positronConsole/browser/components/consoleInstance.css @@ -52,6 +52,7 @@ .console-core .console-instance .console-instance-container { cursor: text; + word-wrap: break-word; } .console-core .console-instance:focus { diff --git a/test/e2e/tests/console/console-output.test.ts b/test/e2e/tests/console/console-output.test.ts index 1595370be5f..9a0820fe170 100644 --- a/test/e2e/tests/console/console-output.test.ts +++ b/test/e2e/tests/console/console-output.test.ts @@ -3,7 +3,7 @@ * Licensed under the Elastic License 2.0. See LICENSE.txt for license information. *--------------------------------------------------------------------------------------------*/ -import { test, tags } from '../_test.setup'; +import { test, tags, expect } from '../_test.setup'; test.use({ suiteId: __filename @@ -16,6 +16,16 @@ test.describe('Console Output', { tag: [tags.WIN, tags.CONSOLE, tags.WEB] }, () await app.workbench.console.waitForConsoleContents('Why do programmers prefer dark mode'); await app.workbench.console.waitForConsoleContents('Because light attracts bugs!'); }); + + test('Long console output wraps appropriately', async function ({ app, page, python }) { + await app.workbench.console.waitForReady('>>>'); + await app.workbench.console.pasteCodeToConsole(pyCode); + await app.workbench.console.sendEnterKey(); + await app.workbench.console.waitForReady('>>>'); + + const el = page.locator('.console-instance'); + await expect(await el.evaluate((el) => el.scrollWidth)).toBeLessThanOrEqual(await el.evaluate((el) => el.clientWidth)); + }); }); const rCode = `tokens <- c( @@ -38,3 +48,5 @@ const rCode = `tokens <- c( cat(token) Sys.sleep(0.01) }`; + +const pyCode = `"Blah" * 300`;