aboutsummaryrefslogtreecommitdiff
path: root/src/repl.c
diff options
context:
space:
mode:
authorDominik Kaiser2024-06-25 14:02:02 +0200
committerGitHub2024-06-25 14:02:02 +0200
commit97cca528658e5b811a56600b7c0b4f9c11bf83fc (patch)
tree38120dd91e74a8f5073a5af414245ccbf4fbd417 /src/repl.c
parent0d7a57a7bc14831d6d7076ccb0ea7a7213ddd7fb (diff)
downloadminishell-97cca528658e5b811a56600b7c0b4f9c11bf83fc.tar.gz
minishell-97cca528658e5b811a56600b7c0b4f9c11bf83fc.zip
Add basic command line
* Initialize terminal and signal handling * Add basic repl that doesn't do anything yet * Add handling for Ctrl-C, Ctrl-D and Ctrl-\ in interactive mode
Diffstat (limited to 'src/repl.c')
-rw-r--r--src/repl.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/repl.c b/src/repl.c
new file mode 100644
index 0000000..f97af6c
--- /dev/null
+++ b/src/repl.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* repl.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/06/24 16:07:04 by dkaiser #+# #+# */
+/* Updated: 2024/06/25 13:50:19 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "minishell.h"
+
+void repl(const char *prompt)
+{
+ char *input;
+
+ while (1)
+ {
+ input = readline(prompt);
+ if (input == NULL)
+ return ;
+ free(input);
+ }
+}