@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
3
3
import 'package:flutter/rendering.dart' ;
4
4
import 'package:flutter/services.dart' ;
5
5
import 'package:xterm/src/core/buffer/cell_offset.dart' ;
6
-
7
6
import 'package:xterm/src/core/input/keys.dart' ;
8
7
import 'package:xterm/src/terminal.dart' ;
9
8
import 'package:xterm/src/ui/controller.dart' ;
@@ -163,8 +162,7 @@ class TerminalViewState extends State<TerminalView> {
163
162
164
163
late ScrollController _scrollController;
165
164
166
- RenderTerminal get renderTerminal =>
167
- _viewportKey.currentContext! .findRenderObject () as RenderTerminal ;
165
+ RenderTerminal get renderTerminal => _viewportKey.currentContext! .findRenderObject () as RenderTerminal ;
168
166
169
167
@override
170
168
void initState () {
@@ -265,7 +263,8 @@ class TerminalViewState extends State<TerminalView> {
265
263
onComposing: _onComposing,
266
264
onAction: (action) {
267
265
_scrollToBottom ();
268
- if (action == TextInputAction .done) {
266
+ // Android sends TextInputAction.newline when the user presses the virtual keyboard's enter key.
267
+ if (action == TextInputAction .done || action == TextInputAction .newline) {
269
268
widget.terminal.keyInput (TerminalKey .enter);
270
269
}
271
270
},
@@ -301,10 +300,8 @@ class TerminalViewState extends State<TerminalView> {
301
300
terminalController: _controller,
302
301
onTapUp: _onTapUp,
303
302
onTapDown: _onTapDown,
304
- onSecondaryTapDown:
305
- widget.onSecondaryTapDown != null ? _onSecondaryTapDown : null ,
306
- onSecondaryTapUp:
307
- widget.onSecondaryTapUp != null ? _onSecondaryTapUp : null ,
303
+ onSecondaryTapDown: widget.onSecondaryTapDown != null ? _onSecondaryTapDown : null ,
304
+ onSecondaryTapUp: widget.onSecondaryTapUp != null ? _onSecondaryTapUp : null ,
308
305
readOnly: widget.readOnly,
309
306
child: child,
310
307
);
@@ -336,8 +333,7 @@ class TerminalViewState extends State<TerminalView> {
336
333
}
337
334
338
335
Rect get globalCursorRect {
339
- return renderTerminal.localToGlobal (renderTerminal.cursorOffset) &
340
- renderTerminal.cellSize;
336
+ return renderTerminal.localToGlobal (renderTerminal.cursorOffset) & renderTerminal.cellSize;
341
337
}
342
338
343
339
void _onTapUp (TapUpDetails details) {
0 commit comments