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

No empty line is printed when completed using enter and --expect is given #703

Open
Forist2034 opened this issue Feb 18, 2025 · 3 comments

Comments

@Forist2034
Copy link

Version: 0.16.0

Man about --expect says:

--expect=EXPECT
              Comma separated list of keys used to complete skim

              Comma-separated  list  of keys that can be used to complete sk in addition to the default enter key. When this option is set, sk will print the name of the  key  pressed  as
              the  first  line  of its output  (or  as  the  second line  if --print-query is also used). The line will be empty if sk is completed with the default enter key. If --expect
              option is specified multiple times, sk will expect the union of the keys. --no-expect will clear  the list.

              e.g. sk --expect=ctrl-v,ctrl-t,alt-s --expect=f1,f2,~,@

But run sk --expect=ctrl-v in this directory:

.
├── a
└── b

1 directory, 2 files

and select a using enter will only print:

./a

@LoricAndre
Copy link
Contributor

Hi,
That is the expected behavior: --expect=ctrl-v will print ctrl-v only if you used this key to confirm. Try running sk with the same options and pressing ctrl-v.
Also, expect is on its way to deprecation, even though it is not official yet. I'd advise you to use --bind 'enter:accept(foo)' to print foo when accepting items with enter, or --bind 'ctrl-v:accept(ctrl-v)' to mimic the behavior of the command in your issue.

@Forist2034
Copy link
Author

But maybe the document should be updated to reflect that behavior?

@LoricAndre
Copy link
Contributor

I think I might have misunderstood what you mean, sorry about that. I see that the empty line is indeed not printed, I will update the docs and hasten the deprecation of expect.
Thank you for the report

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

2 participants