aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakobst1n <jakob.stendahl@outlook.com>2024-06-12 00:36:52 +0200
committerjakobst1n <jakob.stendahl@outlook.com>2024-06-12 00:36:52 +0200
commit42c249ebe1cbfaac82b8fb349c34e6110d1df89f (patch)
treeacf264985c0154c74c2c0b27da3e68ebac630078
parent8ea7035581c4d5aa24e5f3995659171b3707556c (diff)
downloadtextgraph-42c249ebe1cbfaac82b8fb349c34e6110d1df89f.tar.gz
textgraph-42c249ebe1cbfaac82b8fb349c34e6110d1df89f.zip
Toggle cursor for filter mode
-rw-r--r--README.md2
-rw-r--r--src/main.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index cc8bac4..6f5046c 100644
--- a/README.md
+++ b/README.md
@@ -11,4 +11,4 @@ watch some state in a sql table for a short while.
The documentation is in the manual file `tg.1`.
-
+It is only tested with glibc and terminals with ansi escape code support.
diff --git a/src/main.rs b/src/main.rs
index 1d3ba02..3e827d9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,6 +4,7 @@ use textgraph::graph::GraphBuilder;
use textgraph::parseopts::{parseopts, OptsBuilder};
extern "C" fn handle_sigint(_sig: i32) {
+ print!("\x1b[?25h");
print!("\x1B[?1049l");
io::stdout().flush().unwrap();
std::process::exit(0);
@@ -56,6 +57,7 @@ fn build_graph(x_values: &Vec<f64>, y_values: &Vec<f64>, opts: &OptsBuilder) ->
fn filter(opts: OptsBuilder) {
set_filter_signalhandler();
print!("\x1b[?1049h");
+ print!("\x1b[?25l");
let mut x_values: Vec<f64> = Vec::new();
let mut y_values: Vec<f64> = Vec::new();