TerminalStudio / xterm.dart

💻 xterm.dart is a fast and fully-featured terminal emulator for Flutter, with support for mobile and desktop platforms.
https://pub.dev/packages/xterm
MIT License
506 stars 97 forks source link

Null check operator used on a null value #195

Open crioux opened 5 months ago

crioux commented 5 months ago
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
package:xterm/src/utils/circular_buffer.dart 105:28                            IndexAwareCircularBuffer.[]
package:xterm/src/core/buffer/buffer.dart 135:17                               Buffer.currentLine
package:xterm/src/core/buffer/buffer.dart 121:18                               Buffer.writeChar
package:xterm/src/terminal.dart 389:13                                         Terminal.writeChar
package:xterm/src/core/escape/parser.dart 53:15                                EscapeParser._processChar
package:xterm/src/core/escape/parser.dart 46:9                                 EscapeParser._process
package:xterm/src/core/escape/parser.dart 31:5                                 EscapeParser.write
package:xterm/src/terminal.dart 228:13                                         Terminal.write

Getting this stack trace when I create a Terminal as such:

final globalDebugTerminal = Terminal(
  maxLines: 50000,
);

I have a log that is filling this globalDebugTerminal up without having any TerminalView widget created, and then when i go and create a TerminalView widget to view the contents as such:

            TerminalView(globalDebugTerminal,
                textStyle: kDefaultTerminalStyle,
                controller: _terminalController,
                //autofocus: true,
                backgroundOpacity: _showEllet ? 0.75 : 1.0,
                onSecondaryTapDown: (details, offset) async {
              await copySelection(context);
            })

It throws the exception above.