From 24896c1b6a5d24135e52e44474eaab11f7404bf1 Mon Sep 17 00:00:00 2001 From: Marc Gedeon Date: Thu, 19 Mar 2026 00:48:18 +0200 Subject: [PATCH] feat(serial-monitor): replace virtual list with textarea for native text selection - Replaces react-window FixedSizeList with a readOnly textarea - Enables native Ctrl+A, mouse drag selection, and Shift+click - Fixes #812 --- .../monitor/serial-monitor-send-output.tsx | 82 +++++++------------ 1 file changed, 31 insertions(+), 51 deletions(-) diff --git a/arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx b/arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx index d031fb6d654..91d0797e52e 100644 --- a/arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx +++ b/arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx @@ -1,8 +1,6 @@ import React from '@theia/core/shared/react'; import { Event } from '@theia/core/lib/common/event'; import { DisposableCollection } from '@theia/core/lib/common/disposable'; -import { areEqual, FixedSizeList as List } from 'react-window'; -import dateFormat from 'dateformat'; import { messagesToLines, truncateLines, joinLines } from './monitor-utils'; import { MonitorManagerProxyClient } from '../../../common/protocol'; import { MonitorModel } from '../../monitor-model'; @@ -18,11 +16,11 @@ export class SerialMonitorOutput extends React.Component< * Do not touch it. It is used to be able to "follow" the serial monitor log. */ protected toDisposeBeforeUnmount = new DisposableCollection(); - private listRef: React.RefObject; + private serialTextAreaRef = React.createRef(); + constructor(props: Readonly) { super(props); - this.listRef = React.createRef(); this.state = { lines: [], timestamp: this.props.monitorModel.timestamp, @@ -31,24 +29,32 @@ export class SerialMonitorOutput extends React.Component< } override render(): React.ReactNode { - return ( - - {Row} - - ); - } + const text = joinLines(this.state.lines).replace(/\u0000/g, '\u25A1'); + return ( +