danr / libkak

Configure and control Kakoune from python | Hosts a Kakoune Language Server Protocol implementation too for now
MIT License
17 stars 2 forks source link

Incompatible shell commands #6

Open sebsebmc opened 7 years ago

sebsebmc commented 7 years ago

When trying to run this through bash on windows I always get errors in the debug buffer coming from Kakoune trying to execute shell scripts. There seems to be \bin\sh incompatible (non-POSIX compliant) syntax starting on this line.

I get the following errors after launching Kakoune and switching between insert and normal mode

shell stderr: <<<
/bin/sh: 2: [[: not found
/bin/sh: 4: Syntax error: redirection unexpected
>>>
danr commented 7 years ago

Thanks. There are other bashisms used at other places too, like ${var/pattern/replacement}, but now that there's an interest to change them I might get around to actually doing it :)

sebsebmc commented 7 years ago

Can I ask what the replacements ${ //_/_u} here are doing? I've managed to replace most of the bashisms but I'm not sure what the purpose of this replacement is.

danr commented 7 years ago

The goal is to replace all newlines with _n, so first underscores are replaced to _u.

This can be done using calling sed instead of bash substitutions.

I'll happily accept PRs that posixify the shell expansions!