[vte] vteapp: Add --cursor-shape option
- From: Christian Persch <chpe src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vte] vteapp: Add --cursor-shape option
- Date: Thu, 3 Dec 2009 17:33:31 +0000 (UTC)
commit 7d755a30393124319d3406efb98a5f612538501b
Author: Christian Persch <chpe gnome org>
Date: Thu Dec 3 18:32:35 2009 +0100
vteapp: Add --cursor-shape option
Use --cursor-shape=block|ibeam|underline to test cursor shapes.
src/vteapp.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/vteapp.c b/src/vteapp.c
index 9302d30..15b7732 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -450,7 +450,7 @@ main(int argc, char **argv)
VteTerminal *terminal;
char *env_add[] = {
#ifdef VTE_DEBUG
- "FOO=BAR", "BOO=BIZ",
+ (char *) "FOO=BAR", (char *) "BOO=BIZ",
#endif
NULL};
const char *background = NULL;
@@ -469,6 +469,7 @@ main(int argc, char **argv)
const char *termcap = NULL;
const char *command = NULL;
const char *working_directory = NULL;
+ char *cursor_shape = NULL;
GdkColor fore, back, tint, highlight, cursor;
const GOptionEntry options[]={
{
@@ -563,6 +564,11 @@ main(int argc, char **argv)
"Enable a colored cursor", NULL
},
{
+ "cursor-shape", 0, 0,
+ G_OPTION_ARG_STRING, &cursor_shape,
+ "Set cursor shape (block, underline, ibeam)", NULL
+ },
+ {
"scroll-background", 's', 0,
G_OPTION_ARG_NONE, &scroll,
"Enable a scrolling background", NULL
@@ -780,6 +786,13 @@ main(int argc, char **argv)
if (cursor_set) {
vte_terminal_set_color_cursor(terminal, &cursor);
}
+ if (g_strcmp0(cursor_shape, "underline")) {
+ vte_terminal_set_cursor_shape(terminal, VTE_CURSOR_SHAPE_UNDERLINE);
+ } else if (g_strcmp0(cursor_shape, "underline")) {
+ vte_terminal_set_cursor_shape(terminal, VTE_CURSOR_SHAPE_IBEAM);
+ } else {
+ vte_terminal_set_cursor_shape(terminal, VTE_CURSOR_SHAPE_BLOCK);
+ }
if (termcap != NULL) {
vte_terminal_set_emulation(terminal, termcap);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]