Giter Club home page Giter Club logo

Comments (6)

jett06 avatar jett06 commented on September 27, 2024 1

I think the percent sign appearing unexpectedly is more than likely caused by a mismatch between user expectation and the default behaviour of pass-rs. Most programs are expected to give output with a newline by default, but pass-rs requires this to be explicitly stated (see: -n argument), which ZSH doesn't like (links to StackOverflow post with comments detailing the purpose of ZSH's highlighted percent sign, which simply appears when a program does not produce a newline).

From a developer standpoint, the best course of action would be to invert the current newline handling behaviour (see: echo output in ZSH below and note the opposite behaviour is true for pass-rs), and the -n argument along with it.

# using full path to echo b/c zsh has its own version of echo that may be inconsistent w/the GNU impl:
# "which echo" => "echo: shell built-in command"
$ /usr/bin/echo password 
password
$ /usr/bin/echo -n password
password%
$ pass-rs
6V4ioiG1BhBmfE5k5N3Jvjy5kDvv3EBZxF34CS%
$ pass-rs -n
z7Zb4mEgaDb571JSVBQKtCxq0P7tWEng4S8NzT

PS: I apologize for the necro, but I assumed it was fine given the fact that this issue is still open over a year later.
PPS: Jarusk, thanks for the cool CLI tool!

from pass-rs.

Jarusk avatar Jarusk commented on September 27, 2024 1

I think the percent sign appearing unexpectedly is more than likely caused by a mismatch between user expectation and the default behaviour of pass-rs. Most programs are expected to give output with a newline by default, but pass-rs requires this to be explicitly stated (see: -n argument), which ZSH doesn't like (links to StackOverflow post with comments detailing the purpose of ZSH's highlighted percent sign, which simply appears when a program does not produce a newline).

From a developer standpoint, the best course of action would be to invert the current newline handling behaviour (see: echo output in ZSH below and note the opposite behaviour is true for pass-rs), and the -n argument along with it.

# using full path to echo b/c zsh has its own version of echo that may be inconsistent w/the GNU impl:
# "which echo" => "echo: shell built-in command"
$ /usr/bin/echo password 
password
$ /usr/bin/echo -n password
password%
$ pass-rs
6V4ioiG1BhBmfE5k5N3Jvjy5kDvv3EBZxF34CS%
$ pass-rs -n
z7Zb4mEgaDb571JSVBQKtCxq0P7tWEng4S8NzT

PS: I apologize for the necro, but I assumed it was fine given the fact that this issue is still open over a year later. PPS: Jarusk, thanks for the cool CLI tool!

Thanks for the info @jett06 , definitely makes sense! I'll look into making that tweak and cutting a release. Newline by default used to be the only option, then that flag was added.

from pass-rs.

jett06 avatar jett06 commented on September 27, 2024 1

Works as expected with the new commit :)

$ pass-rs
eP98seS1iX68p7a260GYsZo7iWsk35mxX3kCaw
$ pass-rs -n
u0maIujnRIP5usSXK8V051frPPxlofO4HGO78V%

Thanks!

from pass-rs.

Jarusk avatar Jarusk commented on September 27, 2024 1

Works as expected with the new commit :)

$ pass-rs
eP98seS1iX68p7a260GYsZo7iWsk35mxX3kCaw
$ pass-rs -n
u0maIujnRIP5usSXK8V051frPPxlofO4HGO78V%

Thanks!

Glad to hear! Thanks for the help!

from pass-rs.

yaraskm avatar yaraskm commented on September 27, 2024

I don't have a Mac to test anymore, but can take a look!

from pass-rs.

Jarusk avatar Jarusk commented on September 27, 2024

Hey @YOKAICODE , I just released version v0.3.3. I don't have a Mac to test, so would you be able to confirm that the issue still impacts you?

I've added a test matrix and if this is still an issue I'll add better coverage and try to replicate the issue in tests. Thanks!

from pass-rs.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.