matryer / matryer/xbar

Multiple shell commands in bash= call fail

Open
#786 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
18.1k
Forks
656
PR merge metrics
No merged PRs in 30d

Description

While converting my Bitbar configuration to xbar, I figured out that the bash directive is not working as before. I automated my personal tasks with the bash= directive by concatenating several shell commands with &&. For example: changing shell color, setting correct JAVA version, building and starting SpringBoot application. The following plugin code is stripped down the minimum.

```
XBar Example
---
Tools
--Test Call|bash="(cd $HOME/Library && ls -l)"|terminal=true

```
After selection, the menu item, the shell is going to show this

`zsh: no such file or directory: (cd $HOME/Library && ls -l)
`

Enclosed you'll find a simplified version of such a plugin written in perl.

[xbarSample.1d.pl.txt](https://github.com/matryer/xbar/files/7423439/xbarSample.1d.pl.txt)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached xbarSample.1d.pl.txt and reproduce the bash= action using the minimal example with a parenthesized command chain. Trace the bash= command handling in xbar, then verify that chained shell commands execute successfully and that terminal=true still behaves as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, macos, shell
Domain
desktop-dev, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.