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

[Bug report] Incorrect y/N prompt #174

Closed
2 tasks done
sagargurtu opened this issue May 29, 2024 · 9 comments
Closed
2 tasks done

[Bug report] Incorrect y/N prompt #174

sagargurtu opened this issue May 29, 2024 · 9 comments
Assignees
Labels
not bug | wontfix This is't cz-git bug

Comments

@sagargurtu
Copy link

βœ… Checklist

  • I am using the latest version
  • I have searched FAQ

πŸ“„ System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 340.53 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
  npmPackages:
    commitizen: ^4.3.0 => 4.3.0 
    cz-git: ^1.9.2 => 1.9.2

πŸ”Ž Description

Concise Description

The confirmCommit prompt shows "Yneh".

yneh

Expected behavior

It should show y/N instead.

πŸ”— Reproduction link / repo:

No response

@sagargurtu sagargurtu added the bug Something isn't working label May 29, 2024
@Zhengqbbb
Copy link
Owner

Zhengqbbb commented May 29, 2024

It should show y/N instead.

I don't think there is an error. If the result meets expectations, I hope it can be submitted directly by Enter.
By the way, if you use h, you will understand why it's 'Yneh'.

image

Or you can explain what's error with the default value
Or you can explain what's wrong with the default value.

@Zhengqbbb Zhengqbbb added not bug | wontfix This is't cz-git bug and removed bug Something isn't working labels May 29, 2024
@sagargurtu
Copy link
Author

sagargurtu commented May 29, 2024

Oh gosh, my terminal isn't showing the options (y,n,e,h) below the confirmCommit prompt and I was wondering what that was. Resolving.

@sagargurtu sagargurtu closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
@sagargurtu
Copy link
Author

Here's the screenshot.

screenshot

@Zhengqbbb
Copy link
Owner

Zhengqbbb commented May 29, 2024

Hey man, just h show help + Enter

CleanShot.2024-05-29.at.15.39.56.mp4

@marios1861
Copy link

When selecting e, how can we customize the editor that will be used? I don't want to use vi. thanks

@marios1861
Copy link

marios1861 commented Sep 11, 2024

I found out how to do it. In cz-git/packages/src/shared/utils/editor.ts in the function editor, there is this line of choices:

const editor = opts.editor || process.env.VISUAL || process.env.EDITOR || ed

where ed is vim on unix-like systems. If we change the script declaration in package.json:

"scripts": {
    "commit": "EDITOR='code --wait' cz"
}

The process.env.EDITOR option will be picked up. This is definitely missing from the docs and it would be very helpful so that others don't embark on a similar wild goose chase. Thanks for the package.

@Zhengqbbb
Copy link
Owner

The process.env.EDITOR option will be picked up. This is definitely missing from the docs and it would be very helpful so that others don't embark on a similar wild goose chase. Thanks for the package.

I will add it in the FAQ docs, thank you for your support and pointing out this problem.

@Zhengqbbb
Copy link
Owner

Zhengqbbb commented Sep 28, 2024

@marios1861 The process.env.EDITOR option will be picked up. This is definitely missing from the docs and it would be very helpful so that others don't embark on a similar wild goose chase. Thanks for the package.

Hi, The latest version 🌟(v1.10.0)🌟 add env CZ_EDITOR to control what EDITOR use. Avoid affecting others or env.

please have a try πŸ’ͺ and check document information
https://cz-git.qbb.sh/faq/#modifying-the-editor-editor-used-when-choosing-to-edit-during-commit-confirmation-yneh

@marios1861
Copy link

Hi! Lovely work!! I would only add a link to the cross-env docs to keep it self contained. Thanks for the package πŸ‘‘.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not bug | wontfix This is't cz-git bug
Projects
None yet
Development

No branches or pull requests

3 participants