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
29bff837
Commit
29bff837
authored
Oct 04, 2022
by
Matan Ziv-Av
Committed by
Kurt Hindenburg
Oct 21, 2022
Browse files
Track error status of the command in the line properties.
parent
d920a41a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Screen.cpp
View file @
29bff837
...
...
@@ -2346,6 +2346,26 @@ void Screen::setReplMode(int mode)
}
}
void
Screen
::
setExitCode
(
int
/*exitCode*/
)
{
int
y
=
_cuY
-
1
;
while
(
y
>=
0
)
{
_lineProperties
[
y
].
flags
.
f
.
error
=
1
;
if
(
_lineProperties
[
y
].
flags
.
f
.
prompt_start
)
{
return
;
}
y
--
;
}
while
(
y
>
-
_history
->
getLines
())
{
LineProperty
prop
=
_history
->
getLineProperty
(
y
+
_history
->
getLines
());
prop
.
flags
.
f
.
error
=
1
;
_history
->
setLineProperty
(
y
+
_history
->
getLines
(),
prop
);
if
(
prop
.
flags
.
f
.
prompt_start
)
{
return
;
}
y
--
;
}
}
void
Screen
::
fillWithDefaultChar
(
Character
*
dest
,
int
count
)
{
std
::
fill_n
(
dest
,
count
,
Screen
::
DefaultChar
);
...
...
src/Screen.h
View file @
29bff837
...
...
@@ -579,6 +579,7 @@ public:
* REPL_OUTPUT
*/
void
setReplMode
(
int
mode
);
void
setExitCode
(
int
exitCode
);
/** Return true if semantic shell integration is in use. */
bool
hasRepl
()
const
{
...
...
src/Vt102Emulation.cpp
View file @
29bff837
...
...
@@ -1067,7 +1067,14 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
auto
list
=
value
.
split
(
QLatin1Char
(
';'
));
for
(
int
i
=
1
;
i
<
list
.
size
();
i
++
)
{
int
eq
=
list
.
at
(
i
).
indexOf
(
QLatin1Char
(
'='
));
if
(
eq
>
0
)
{
if
(
i
==
1
&&
value
[
0
]
==
QLatin1Char
(
'D'
))
{
// Special case - exit code without '='
params
[
QLatin1String
(
"exit_code"
)]
=
list
.
at
(
1
);
int
exitCode
=
list
.
at
(
1
).
toInt
();
if
(
exitCode
)
{
_currentScreen
->
setExitCode
(
exitCode
);
}
}
else
if
(
eq
>
0
)
{
params
[
list
.
at
(
i
).
mid
(
0
,
eq
)]
=
list
.
at
(
i
).
mid
(
eq
+
1
);
}
}
...
...
src/characters/Character.h
View file @
29bff837
...
...
@@ -41,6 +41,7 @@ public:
uint
output_start
:
1
;
uint
input_start
:
1
;
uint
output
:
1
;
uint
error
:
1
;
}
f
;
}
flags
;
qint16
length
;
...
...
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