Skip to content

Commit d1aed34

Browse files
committed
bestlineover readline in shell
1 parent 2c45550 commit d1aed34

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

llama.cpp/embedfile/shell.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,21 @@ typedef unsigned char u8;
178178

179179
#else
180180

181-
# define shell_read_history(X)
182-
# define shell_write_history(X)
181+
#include "llamafile/bestline.h"
182+
# define shell_add_history(X) bestlineHistoryAdd(X)
183+
# define shell_read_history(X) bestlineHistoryLoad(X)
184+
# define shell_write_history(X) bestlineHistorySave(X)
183185
# define shell_stifle_history(X)
184-
185-
# define SHELL_USE_LOCAL_GETLINE 1
186+
# define shell_readline(X) bestline(X)
187+
188+
//#else
189+
//
190+
//# define shell_read_history(X)
191+
//# define shell_write_history(X)
192+
//# define shell_stifle_history(X)
193+
//
194+
//# define SHELL_USE_LOCAL_GETLINE 1
195+
//#endif
186196
#endif
187197

188198
#ifndef deliberate_fall_through

0 commit comments

Comments
 (0)