Skip to content

Misc. bug: Ctrl+D no longer works properly #12949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
danielzgtg opened this issue Apr 15, 2025 · 0 comments · Fixed by #12951
Closed

Misc. bug: Ctrl+D no longer works properly #12949

danielzgtg opened this issue Apr 15, 2025 · 0 comments · Fixed by #12951

Comments

@danielzgtg
Copy link
Contributor

Name and Version

$./llama-cli --version
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 ROCm devices:
Device 0: AMD Radeon RX 6650 XT, gfx1030 (0x1030), VMM: no, Wave Size: 32
version: 5097 (fe5b78c)
built with cc (Ubuntu 14.2.0-4ubuntu2) 14.2.0 for x86_64-linux-gnu

Operating systems

Linux

Which llama.cpp modules do you know to be affected?

llama-cli

Command line

llama-cli -m ~/gemma-3-4b-it-Q4_K_M.gguf
llama-cli -m ~/gemma-3-4b-it-Q4_K_M.gguf </dev/null

Problem description & steps to reproduce

The multiline feature caused #491 to regress. I expect Ctrl+D to behave exactly like it does in bash. Instead, it's as if it was Enter, and Ctrl+C doesn't work when it is held down by /dev/null either.

First Bad Commit

Perhaps 41654ef

Relevant log output

...
== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to the AI.
 - To return control without starting a new line, end your input with '/'.
 - If you want to submit another line, end your input with '\'.
 - Not using system message. To change it, set a different value via -sys PROMPT


> Hi
Hi there! How’s your day going so far? Is there anything I can help you with today? 😊 

Do you want to:

*   Chat about something?
*   Get some information?
*   Brainstorm ideas?

> *   Play a game?

> 

> 

> 

> 

> 
llama_perf_sampler_print:    sampling time =       0.16 ms /     1 runs   (    0.16 ms per token,  6172.84 tokens per second)
llama_perf_context_print:        load time =     793.98 ms
llama_perf_context_print: prompt eval time =     185.32 ms /    10 tokens (   18.53 ms per token,    53.96 tokens per second)
llama_perf_context_print:        eval time =    4524.32 ms /    62 runs   (   72.97 ms per token,    13.70 tokens per second)
llama_perf_context_print:       total time =   13648.78 ms /    72 tokens
Interrupted by user
...
== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to the AI.
 - To return control without starting a new line, end your input with '/'.
 - If you want to submit another line, end your input with '\'.
 - Not using system message. To change it, set a different value via -sys PROMPT


> The 2023 NFL Draft is less than two weeks away, and the anticipation^C
>  is building^C
> . Here’^C
> s a breakdown^C
>  of the top^C
>  storylines, key^C
>  players, and^C
>  potential surprises heading into^C
>  the event^C
> :

**^C
> 1.^C
>  The Quarterback^C
>  Carousel:**^C
> 

* **^C
> The Big Three^C
> :** Caleb Williams^C
>  (USC),^\Quit (core dumped)
danielzgtg added a commit to danielzgtg/llama.cpp that referenced this issue Apr 16, 2025
This restores the behavior from ggml-org#491. This does not affect Ctrl+D's ability to
terminate --multiline-input lines (ggml-org#1040).

This also actually implements ggml-org#587: "If the user wants the text to end in a
newline, this should be accomplished by explicitly adding a newline by using
\ followed by return, then returning control by pressing return again."

Fixes ggml-org#12949
@ngxson ngxson closed this as completed in 6408210 Apr 18, 2025
colout pushed a commit to colout/llama.cpp that referenced this issue Apr 21, 2025
This restores the behavior from ggml-org#491. This does not affect Ctrl+D's ability to
terminate --multiline-input lines (ggml-org#1040).

This also actually implements ggml-org#587: "If the user wants the text to end in a
newline, this should be accomplished by explicitly adding a newline by using
\ followed by return, then returning control by pressing return again."

Fixes ggml-org#12949
pockers21 pushed a commit to pockers21/llama.cpp that referenced this issue Apr 28, 2025
This restores the behavior from ggml-org#491. This does not affect Ctrl+D's ability to
terminate --multiline-input lines (ggml-org#1040).

This also actually implements ggml-org#587: "If the user wants the text to end in a
newline, this should be accomplished by explicitly adding a newline by using
\ followed by return, then returning control by pressing return again."

Fixes ggml-org#12949
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant