Skip to content
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

Extraneous space for multiline args #132

Open
bwhaley opened this issue Mar 10, 2020 · 0 comments
Open

Extraneous space for multiline args #132

bwhaley opened this issue Mar 10, 2020 · 0 comments

Comments

@bwhaley
Copy link

bwhaley commented Mar 10, 2020

First and foremost, thanks for this project! I've been using it successfully in my AWS Parameter Store shell project.

I've noticed that an extraneous space is added in values with new lines. Here's a reproducible example:

package main

import (
	"github.com/abiosoft/ishell"
)

func main() {
	shell := ishell.New()
	shell.AddCmd(&ishell.Cmd{
		Name: "test",
		Func: func(c *ishell.Context) {
			shell.Printf("Got: '%x'\n", c.Args[0])
		},
	})
	shell.Run()
}
>>> test "foo\
... bar"
Got: '666f6f200a626172'

In the hex output we see:

666f6f - foo
200a - <space><newline>
626172 - bar

The space here is unexpected. I did start looking through the code here but ran out of time before I figured out where it was happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant