aboutsummaryrefslogtreecommitdiff
path: root/module-test
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-09 03:41:56 +0000
committer_ov4 <ov4@ov4.org>2026-10-09 03:41:56 +0000
commitc47cfb32f4ca9ed7bbb360053d90f1fb52a95708 (patch)
tree0d186530cbccb6f14f5230da1ad145b4c98aeac0 /module-test
parentd29590546054feabff2d7e559665811d1d28f538 (diff)
add line editor history
Diffstat (limited to 'module-test')
-rw-r--r--module-test/line_test.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/module-test/line_test.cc b/module-test/line_test.cc
index ea149ff..2ad6f32 100644
--- a/module-test/line_test.cc
+++ b/module-test/line_test.cc
@@ -5,6 +5,7 @@
src/line/mode.cc \
src/line/cursor.cc \
src/line/getter.cc \
+ src/history.cc \
-std=c++26 -Iinclude -Ithird_party/magic_enum/include \
-O0 -ggdb3 -fno-omit-frame-pointer -fno-inline -D_GLIBCXX_ASSERTIONS \
-o module-test/line_test.out
@@ -26,15 +27,18 @@ using namespace ov4;
int main()
{
- print("shell $ ");
- enable_raw();
- T_position pos = get_cursor_position();
- cursor_row = pos.row;
- cursor_col = pos.col;
- prompt_pos = cursor_col;
- string s = readline();
- disable_raw();
- cout << "\n\n\n\n" << endl;
- cout << s << endl;
+ while (true)
+ {
+ print("shell $ ");
+ enable_raw();
+ T_position pos = get_cursor_position();
+ cursor_row = pos.row;
+ cursor_col = pos.col;
+ prompt_pos = cursor_col;
+ string s = readline();
+ disable_raw();
+ cout << "\n\n\n\n" << endl;
+ cout << s << endl;
+ }
return 0;
}