aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-18 15:04:33 +0000
committer_ov4 <ov4@ov4.org>2026-10-18 15:04:33 +0000
commit83588b7ee9349a941b91294fa83fe6e207883ab6 (patch)
tree7d28007f38dcc4efec72f0875d54e5b44df09db6 /src
parentf7319b36f4f48cdf065b9a1472c9a848ca6f95bc (diff)
fix uninitialized fd[]
Diffstat (limited to 'src')
-rw-r--r--src/init.cc2
-rw-r--r--src/line/cursor.cc5
-rw-r--r--src/line/input.cc2
-rw-r--r--src/signal/sigwinch_handler.cc2
4 files changed, 5 insertions, 6 deletions
diff --git a/src/init.cc b/src/init.cc
index a38aec4..a28b5bb 100644
--- a/src/init.cc
+++ b/src/init.cc
@@ -1,6 +1,7 @@
#include "init.h"
#include <fcntl.h>
+#include "pipe.h"
using namespace std;
@@ -15,6 +16,7 @@ This is free software; see the source for copying conditions. \
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \n\
Published under GNU AFFERO GENERAL PUBLIC LICENSE (AGPL) Version 3." << endl;
+ self_pipe_init();
signal_init();
tty_fd = open("/dev/tty", O_RDWR);
diff --git a/src/line/cursor.cc b/src/line/cursor.cc
index 1baa33c..16665a5 100644
--- a/src/line/cursor.cc
+++ b/src/line/cursor.cc
@@ -18,7 +18,6 @@ namespace ov4
void T_line_editor::print_override(const std::string &s)
{
- check_window_update();
// save current cursor position
// print("\x1b[s"); fflush(stdout);
@@ -42,7 +41,6 @@ void T_line_editor::print_override(const std::string &s)
void T_line_editor::move_cursor(char c)
{
- check_window_update();
switch (c)
{
@@ -65,7 +63,6 @@ void T_line_editor::move_cursor(char c)
void T_line_editor::cursor_input_char(char c)
{
- check_window_update();
// if receives any input
// it should move to the latest history
@@ -106,7 +103,6 @@ void T_line_editor::update_window_size()
void T_line_editor::move_cursor(T_cursor_movement_direction d)
{
- check_window_update();
switch (d)
{
@@ -170,7 +166,6 @@ void T_line_editor::move_cursor(T_cursor_movement_direction d)
void T_line_editor::switch_history(T_cursor_movement_direction d)
{
- check_window_update();
switch (d)
{
diff --git a/src/line/input.cc b/src/line/input.cc
index 1e7ca38..0a01760 100644
--- a/src/line/input.cc
+++ b/src/line/input.cc
@@ -34,7 +34,7 @@ string T_line_editor::readline()
if (src == self_pipe_fd[0])
{
check_window_update();
- break;
+ continue;
}
if (iscntrl(c))
{
diff --git a/src/signal/sigwinch_handler.cc b/src/signal/sigwinch_handler.cc
index 20d4550..a686328 100644
--- a/src/signal/sigwinch_handler.cc
+++ b/src/signal/sigwinch_handler.cc
@@ -1,6 +1,7 @@
#include "signal_handler.h"
#include "line/line_editor.h"
+#include "pipe.h"
namespace ov4
{
@@ -8,6 +9,7 @@ namespace ov4
void sigwinch_handler([[maybe_unused]] int sig)
{
windows_size_changed = true;
+ self_pipe_write();
}
} \ No newline at end of file