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

Could not edit file in Kakoune by specifying client and server #869

Open
VKondakoff opened this issue Apr 12, 2024 · 3 comments
Open

Could not edit file in Kakoune by specifying client and server #869

VKondakoff opened this issue Apr 12, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@VKondakoff
Copy link

Hi!

Here is excerpt from Kakoune docs:

if you need an actual explorer to interact with the editor, you can create a Kakoune script that will 
spawn the tool in question, which should in return send an "edit" command followed by the path 
of the file you selected to the current Kakoune session 
(e.g. echo "eval -client $kak_client edit /path/to/file" | kak -p $kak_session)

I'm trying to set Broot like this. Here is my verb:

{
        invocation: edit
        shortcut: e
        key: enter
        apply_to: text_file
        execution: "echo eval -client client0 edit {file} | kak -p vk"
        leave_broot: false
}

Unfortunately when I press Enter on a text-file just nothing happens (command is echoed, though):
Снимок экрана 2024-04-12 в 22 26 51

If I run the same command manually form command line - everything works as expected, the file is successfully opened in specified Kakoune session:
Снимок экрана 2024-04-12 в 22 29 40

What may be wrong here? Am I missing something?
Thank you!

@VKondakoff VKondakoff added the bug Something isn't working label Apr 12, 2024
@VKondakoff
Copy link
Author

Please, give me some ideas, what may be wrong!
Everything works as expected if I'm running this from command line (zsh, macOS):

echo eval -client vk edit ~/.config/broot/verbs.hjson | kak -p vk

But nothing happens if I'm adding the same line to verbs.hjson:

    {
        invocation: edit
        shortcut: e
        key: enter
        apply_to: text_file
        execution: "echo eval -client vk edit ~/.config/broot/verbs.hjson | kak -p vk"
        leave_broot: true
    }

@VKondakoff
Copy link
Author

Here is what I see in broot.log:

18:39:46.560 [DEBUG] broot::app::app: cmd_result: Launch
18:39:46.560 [DEBUG] broot::task_sync: dead dam
18:39:46.562 [DEBUG] broot: launching Program {
    exe: "echo",
    args: [
        "eval",
        "-client",
        "vk",
        "edit",
        "/Users/valerykondakoff/.config/broot/conf.hjson",
        "|",
        "kak",
        "-p",
        "dmn2",
    ],
    working_dir: None,
    switch_terminal: true,
    capture_mouse: true,
    keyboard_enhanced: false,
}
18:39:46.562 [DEBUG] broot::launchable: working_dir: None
18:39:46.562 [DEBUG] broot::launchable: switch_terminal: true
18:39:46.567 [INFO] broot: bye

What does this means? Is this quoting issue?

@Canop Canop added the help wanted Extra attention is needed label Apr 25, 2024
@VKondakoff
Copy link
Author

VKondakoff commented May 2, 2024

I'm still experimenting with this.
Let's take this simple command: echo test | grep test. If I run it from command line I'm receiving the following:

Снимок экрана 2024-05-02 в 20 31 04

But if I put the same command to verbs.hjson and press enter on any file in Broot I'm receiving the following:

Снимок экрана 2024-05-02 в 20 33 04
    {
        invocation: edit
        shortcut: e
        key: enter
        apply_to: text_file
        execution: "echo test | grep test"
        leave_broot: true
    }

Is there a way I can pipe the echo output to grep? (MacOS, zsh)

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants