diff --git a/janet.1 b/janet.1 index 6e03808c..ae64a316 100644 --- a/janet.1 +++ b/janet.1 @@ -156,7 +156,7 @@ Shows the version text and exits immediately. .TP .BR \-s -Read raw input from stdin and forgo prompt history and other readline-like features. +Read raw input from stdin and forgo fancy input, which includes prompt history and other readline-like features. .TP .BR \-e\ code @@ -274,7 +274,8 @@ cannot be defined for this variable to have an effect. .B JANET_HISTFILE .RS -A file location to use for the default shell's REPL history. This relative path is where commands are persisted between sessions. +A file location to use for the default shell's REPL history when using fancy input. This relative path is where commands are persisted between sessions. +If unset, no repl history well be used. Does not work with the -s flag where fancy input is disabled. .RE .B NO_COLOR diff --git a/src/mainclient/shell.c b/src/mainclient/shell.c index 4828c444..548728ba 100644 --- a/src/mainclient/shell.c +++ b/src/mainclient/shell.c @@ -437,20 +437,8 @@ static void calc_history_file(void) { if (hist) { gbl_history_file = sdup(hist); } else { - const char *home = (const char *) getenv("HOME"); - if (NULL == home) home = ""; - const char *filename = ".janet_history.jdn"; - size_t homelen = strlen(home); - size_t filelen = strlen(filename); - size_t buflen = homelen + filelen + 1; - char *buffer = janet_malloc(buflen + 1); - if (homelen) memcpy(buffer, home, homelen); - buffer[homelen] = '/'; - memcpy(buffer + homelen + 1, filename, filelen); - buffer[buflen] = '\0'; - gbl_history_file = buffer; + gbl_history_file = NULL; } - /* fprintf(stderr, "history_file: %s\n", gbl_history_file); */ } static void loadhistory(void) {