Skip to content

Commit

Permalink
readline: remove new line \n character from readline output, now just…
Browse files Browse the repository at this point in the history
… Enter produces '' (#18934)
  • Loading branch information
indexxd committed Jul 22, 2023
1 parent a344909 commit bf00ac6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vlib/readline/readline_nix.c.v
Expand Up @@ -133,6 +133,10 @@ pub fn (mut r Readline) read_line_utf8(prompt string) ![]rune {
r.disable_raw_mode()
if r.current.len == 0 {
return error('empty line')
} else {
if r.current.last() == `\n` {
r.current.pop()
}
}
return r.current
}
Expand Down

0 comments on commit bf00ac6

Please sign in to comment.