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

Output is usually empty #741

Closed
matildeopbravo opened this issue Aug 22, 2021 · 4 comments
Closed

Output is usually empty #741

matildeopbravo opened this issue Aug 22, 2021 · 4 comments
Labels
needs-triage More investigation is needed on this issue to understand the problem

Comments

@matildeopbravo
Copy link

  - trigger: ":nif"
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: "grep NIF $HOME/documents | cut -d ':' -f2 | tee >(xclip)"

I have this in my config and whenever I triggered it , it's supposed to replace the trigger by a number and copy to my clipboard as well. The clipboard seems to be working but replacing the text usually doesn't.

@federico-terzi
Copy link
Collaborator

Hey @matildeopbravo,

I'm sorry you experienced this problem! Espanso might be having some problems executing the script. Could you please try to:

  1. Add the debug: true option:
  - trigger: ":nif"
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: "grep NIF $HOME/documents | cut -d ':' -f2 | tee >(xclip)"
          debug: true
  1. Execute the trigger
  2. Run espanso log in the terminal

You should be able to see if any error occurs from the logs, as espanso now reports the exit code, stderr and stdout of the process.

Let me know if that helps

Cheers :)

@federico-terzi federico-terzi added the needs-triage More investigation is needed on this issue to understand the problem label Aug 25, 2021
@matildeopbravo
Copy link
Author

11:31:58 [ INFO] debug for shell cmd 'grep NIF $HOME/documents | cut -d ':' -f2 | tee >(xclip -selection c)', exit_status 'exit code: 0', stdout ' 266372198
', stderr ''
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0
11:31:58 [ WARN] X11 reported an error code: 2, request_code: 101 and minor_code: 0

@federico-terzi
Copy link
Collaborator

@matildeopbravo Interesting, thank you. The script seems to be working correctly, but I suspect the call to xclip is interfering with the way espanso works. Are you using the backend: Clipboard option?

Cheers :)

@federico-terzi
Copy link
Collaborator

Hey,
I'm going to close this issue as it's been a while since the last follow-up.
Let me know if you have other questions.
Cheers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage More investigation is needed on this issue to understand the problem
Projects
None yet
Development

No branches or pull requests

2 participants