summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2013-06-16 23:07:58 +0200
committerBoris Faure <billiob@gmail.com>2013-09-26 21:18:48 +0200
commit68133d2614ca98b50e8b18f77f3772636e86284f (patch)
treec95635861cc661c08932bcfa6465c56582b6cb06
parentef543aa753bc0540b1e32ce4f5c012863975a7fd (diff)
add -2/--256color option to set TERM to xterm-256color
Man page was modified accordingly.
-rw-r--r--man/terminology.14
-rw-r--r--src/bin/ipc.h1
-rw-r--r--src/bin/main.c23
3 files changed, 24 insertions, 4 deletions
diff --git a/man/terminology.1 b/man/terminology.1
index 343cda9..62d04ee 100644
--- a/man/terminology.1
+++ b/man/terminology.1
@@ -120,6 +120,10 @@ Don't exit when the command process exits.
120Force single executable if multi-instance is enabled.. 120Force single executable if multi-instance is enabled..
121. 121.
122.TP 122.TP
123.B \-2, \-\-256color
124Set TERM to \fBxterm-256color\fP instead of \fBxterm\fP.
125.
126.TP
123.B \-V, \-\-version 127.B \-V, \-\-version
124Show program version. 128Show program version.
125. 129.
diff --git a/src/bin/ipc.h b/src/bin/ipc.h
index 76aae28..17c9026 100644
--- a/src/bin/ipc.h
+++ b/src/bin/ipc.h
@@ -26,6 +26,7 @@ struct _Ipc_Instance
26 int maximized; 26 int maximized;
27 int hold; 27 int hold;
28 int nowm; 28 int nowm;
29 int xterm_256color;
29}; 30};
30 31
31void ipc_init(void); 32void ipc_init(void);
diff --git a/src/bin/main.c b/src/bin/main.c
index 5e3fa02..b8260e9 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -2257,6 +2257,7 @@ main_ipc_new(Ipc_Instance *inst)
2257 if (inst->maximized) nargc += 1; 2257 if (inst->maximized) nargc += 1;
2258 if (inst->hold) nargc += 1; 2258 if (inst->hold) nargc += 1;
2259 if (inst->nowm) nargc += 1; 2259 if (inst->nowm) nargc += 1;
2260 if (inst->xterm_256color) nargc += 1;
2260 if (inst->cmd) nargc += 2; 2261 if (inst->cmd) nargc += 2;
2261 2262
2262 nargv = calloc(nargc + 1, sizeof(char *)); 2263 nargv = calloc(nargc + 1, sizeof(char *));
@@ -2378,6 +2379,10 @@ main_ipc_new(Ipc_Instance *inst)
2378 { 2379 {
2379 nargv[i++] = "-W"; 2380 nargv[i++] = "-W";
2380 } 2381 }
2382 if (inst->xterm_256color)
2383 {
2384 nargv[i++] = "-2";
2385 }
2381 if (inst->cmd) 2386 if (inst->cmd)
2382 { 2387 {
2383 nargv[i++] = "-e"; 2388 nargv[i++] = "-e";
@@ -2560,7 +2565,9 @@ static const Ecore_Getopt options = {
2560 "Don't exit when the command process exits."), 2565 "Don't exit when the command process exits."),
2561 ECORE_GETOPT_STORE_TRUE('s', "single", 2566 ECORE_GETOPT_STORE_TRUE('s', "single",
2562 "Force single executable if multi-instance is enabled.."), 2567 "Force single executable if multi-instance is enabled.."),
2563 2568 ECORE_GETOPT_STORE_TRUE('2', "256color",
2569 "Set TERM to 'xterm-256color' instead of 'xterm'."),
2570
2564 ECORE_GETOPT_VERSION ('V', "version"), 2571 ECORE_GETOPT_VERSION ('V', "version"),
2565 ECORE_GETOPT_COPYRIGHT ('C', "copyright"), 2572 ECORE_GETOPT_COPYRIGHT ('C', "copyright"),
2566 ECORE_GETOPT_LICENSE ('L', "license"), 2573 ECORE_GETOPT_LICENSE ('L', "license"),
@@ -2598,7 +2605,8 @@ elm_main(int argc, char **argv)
2598 Eina_Bool single = EINA_FALSE; 2605 Eina_Bool single = EINA_FALSE;
2599#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) 2606#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
2600 Eina_Bool cmd_options = EINA_FALSE; 2607 Eina_Bool cmd_options = EINA_FALSE;
2601#endif 2608#endif
2609 Eina_Bool xterm_256color = EINA_FALSE;
2602 Ecore_Getopt_Value values[] = { 2610 Ecore_Getopt_Value values[] = {
2603#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) 2611#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
2604 ECORE_GETOPT_VALUE_BOOL(cmd_options), 2612 ECORE_GETOPT_VALUE_BOOL(cmd_options),
@@ -2628,7 +2636,8 @@ elm_main(int argc, char **argv)
2628 ECORE_GETOPT_VALUE_BOOL(nowm), 2636 ECORE_GETOPT_VALUE_BOOL(nowm),
2629 ECORE_GETOPT_VALUE_BOOL(hold), 2637 ECORE_GETOPT_VALUE_BOOL(hold),
2630 ECORE_GETOPT_VALUE_BOOL(single), 2638 ECORE_GETOPT_VALUE_BOOL(single),
2631 2639 ECORE_GETOPT_VALUE_BOOL(xterm_256color),
2640
2632 ECORE_GETOPT_VALUE_BOOL(quit_option), 2641 ECORE_GETOPT_VALUE_BOOL(quit_option),
2633 ECORE_GETOPT_VALUE_BOOL(quit_option), 2642 ECORE_GETOPT_VALUE_BOOL(quit_option),
2634 ECORE_GETOPT_VALUE_BOOL(quit_option), 2643 ECORE_GETOPT_VALUE_BOOL(quit_option),
@@ -2808,7 +2817,13 @@ elm_main(int argc, char **argv)
2808 config->disable_visual_bell = !visual_bell; 2817 config->disable_visual_bell = !visual_bell;
2809 config->temporary = EINA_TRUE; 2818 config->temporary = EINA_TRUE;
2810 } 2819 }
2811 2820
2821 if (xterm_256color)
2822 {
2823 config->xterm_256color = EINA_TRUE;
2824 config->temporary = EINA_TRUE;
2825 }
2826
2812 if (geometry) 2827 if (geometry)
2813 { 2828 {
2814 if (sscanf(geometry,"%ix%i+%i+%i", &size_w, &size_h, &pos_x, &pos_y) == 4) 2829 if (sscanf(geometry,"%ix%i+%i+%i", &size_w, &size_h, &pos_x, &pos_y) == 4)