Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
e76442a5
Commit
e76442a5
authored
Dec 08, 2021
by
Waqar Ahmed
Committed by
Tomaz Canabrava
Dec 12, 2021
Browse files
Vt102Emulation: Process common case first
parent
55578408
Pipeline
#108613
passed with stage
in 2 minutes and 1 second
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/Vt102Emulation.cpp
View file @
e76442a5
...
...
@@ -330,7 +330,6 @@ void Vt102Emulation::initTokenizer()
/* clang-format off */
#define lec(P,L,C) (p == (P) && s[(L)] == (C))
#define lun( ) (p == 1 && cc >= 32 )
#define les(P,L,C) (p == (P) && s[L] < 256 && (charClass[s[(L)]] & (C)) == (C))
#define eec(C) (p >= 3 && cc == (C))
#define ees(C) (p >= 3 && cc < 256 && (charClass[cc] & (C)) == (C))
...
...
@@ -360,6 +359,12 @@ void Vt102Emulation::receiveChars(const QVector<uint> &chars)
continue
;
// VT100: ignore.
}
// early out for displayable characters
if
(
getMode
(
MODE_Ansi
)
&&
tokenBufferPos
==
0
&&
cc
>=
32
&&
cc
!=
(
ESC
+
128
))
{
_currentScreen
->
displayCharacter
(
applyCharset
(
cc
));
continue
;
}
if
(
ces
(
CTL
))
{
// ignore control characters in the text part of osc (aka OSC) "ESC]"
// escape sequences; this matches what XTERM docs say
...
...
@@ -442,7 +447,6 @@ void Vt102Emulation::receiveChars(const QVector<uint> &chars)
if
(
lec
(
3
,
2
,
'!'
))
{
continue
;
}
if
(
lec
(
3
,
2
,
SP
))
{
continue
;
}
if
(
lec
(
4
,
3
,
SP
))
{
continue
;
}
if
(
lun
(
))
{
processToken
(
token_chr
(),
applyCharset
(
cc
),
0
);
resetTokenizer
();
continue
;
}
if
(
dcs
)
{
continue
;
/* TODO We don't xterm DCS, so we just eat it */
}
if
(
lec
(
2
,
0
,
ESC
))
{
processToken
(
token_esc
(
s
[
1
]),
0
,
0
);
resetTokenizer
();
continue
;
}
if
(
les
(
3
,
1
,
SCS
))
{
processToken
(
token_esc_cs
(
s
[
1
],
s
[
2
]),
0
,
0
);
resetTokenizer
();
continue
;
}
...
...
src/Vt102Emulation.h
View file @
e76442a5
...
...
@@ -120,8 +120,8 @@ private:
void
resetTokenizer
();
#define MAX_TOKEN_LENGTH 256 // Max length of tokens (e.g. window title)
void
addToCurrentToken
(
uint
cc
);
uint
tokenBuffer
[
MAX_TOKEN_LENGTH
];
// FIXME: overflow?
int
tokenBufferPos
;
uint
tokenBuffer
[
MAX_TOKEN_LENGTH
];
// FIXME: overflow?
#define MAXARGS 15
void
addDigit
(
int
dig
);
void
addArgument
();
...
...
Luis Javier Merino
@ninjalj
mentioned in merge request
!583 (merged)
·
Jan 23, 2022
mentioned in merge request
!583 (merged)
mentioned in merge request !583
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment