Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fingerterm
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mer-core
fingerterm
Commits
c8cabf95
Commit
c8cabf95
authored
Mar 31, 2014
by
Thomas Perl
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #28 from FireyFly/master
Add 256-colour support
parents
9f253372
3b52af7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
terminal.cpp
terminal.cpp
+24
-0
textrender.cpp
textrender.cpp
+16
-1
No files found.
terminal.cpp
View file @
c8cabf95
...
...
@@ -747,6 +747,19 @@ void Terminal::ansiSequence(const QString& seq)
break
;
}
if
(
params
.
count
()
>
0
)
{
// xterm 256-colour support
if
(
params
.
count
()
>
1
&&
(
params
[
0
]
==
38
||
params
[
0
]
==
48
))
{
if
(
params
.
count
()
>
2
&&
params
[
1
]
==
5
&&
params
[
2
]
>=
0
&&
params
[
2
]
<=
255
)
{
if
(
params
[
0
]
==
38
)
iTermAttribs
.
currentFgColor
=
params
[
2
];
else
iTermAttribs
.
currentBgColor
=
params
[
2
];
}
// TODO: 2;r;g;b for 24-bit colour support (Konsole etc)
break
;
}
if
(
params
.
contains
(
0
))
{
iTermAttribs
.
currentFgColor
=
defaultFgColor
;
iTermAttribs
.
currentBgColor
=
defaultBgColor
;
...
...
@@ -774,6 +787,17 @@ void Terminal::ansiSequence(const QString& seq)
iTermAttribs
.
currentBgColor
=
p
-
40
;
}
}
// high-intensity regular-weight extension (nonstandard)
foreach
(
int
p
,
params
)
{
if
(
p
>=
90
&&
p
<=
97
)
{
iTermAttribs
.
currentFgColor
=
p
-
90
+
8
;
}
if
(
p
>=
100
&&
p
<=
107
)
{
iTermAttribs
.
currentBgColor
=
p
-
100
+
8
;
}
}
if
(
params
.
contains
(
39
))
iTermAttribs
.
currentFgColor
=
defaultFgColor
;
if
(
params
.
contains
(
49
))
...
...
textrender.cpp
View file @
c8cabf95
...
...
@@ -42,6 +42,7 @@ TextRender::TextRender(QQuickItem *parent) :
iColorTable
.
append
(
QColor
(
210
,
0
,
210
));
iColorTable
.
append
(
QColor
(
0
,
210
,
210
));
iColorTable
.
append
(
QColor
(
235
,
235
,
235
));
//bright
iColorTable
.
append
(
QColor
(
127
,
127
,
127
));
iColorTable
.
append
(
QColor
(
255
,
0
,
0
));
...
...
@@ -52,7 +53,21 @@ TextRender::TextRender(QQuickItem *parent) :
iColorTable
.
append
(
QColor
(
0
,
255
,
255
));
iColorTable
.
append
(
QColor
(
255
,
255
,
255
));
if
(
iColorTable
.
size
()
!=
16
)
//colour cube
for
(
int
r
=
0x00
;
r
<
0x100
;
r
+=
0x33
)
for
(
int
g
=
0x00
;
g
<
0x100
;
g
+=
0x33
)
for
(
int
b
=
0x00
;
b
<
0x100
;
b
+=
0x33
)
iColorTable
.
append
(
QColor
(
r
,
g
,
b
));
//greyscale ramp
int
ramp
[]
=
{
0
,
11
,
22
,
33
,
44
,
55
,
66
,
77
,
88
,
99
,
110
,
121
,
133
,
144
,
155
,
166
,
177
,
188
,
199
,
210
,
221
,
232
,
243
,
255
};
for
(
int
i
=
0
;
i
<
24
;
i
++
)
iColorTable
.
append
(
QColor
(
ramp
[
i
],
ramp
[
i
],
ramp
[
i
]));
if
(
iColorTable
.
size
()
!=
256
)
qFatal
(
"invalid color table"
);
iShowBufferScrollIndicator
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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