emersion / emersion/mrsh

Interactive command substitution does not work

Open
#148 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
531
Forks
40
PR merge metrics
No merged PRs in 30d

Description

This was discovered while testing and developing https://github.com/ajeetdsouza/zoxide/pull/43. If you try to assign an interactive command (such as `fzf`, which `zoxide query -i` calls after some preprocessing) to a variable, nothing happens.

### STR

1. Grab a usable copy of `fzf` or some other similarly interactive command
2. `var="$(fzf)"`
3. Note the lack of interactivity, as well as the empty `var`

In `dash` and `bash --posix`, this works as expected, with `var` being set to e.g. `Cargo.lock` (or whatever file was picked).

(Feel free to reword the title if it's misleading; I'm not exactly a shell expert, so I may have used incorrect terminology.)

EDIT: Pictures.

#### `mrsh`
![image](https://user-images.githubusercontent.com/28582702/77184934-c79b5400-6a8d-11ea-8d39-3cb6d9f7d01f.png)

#### `dash`
![image](https://user-images.githubusercontent.com/28582702/77185012-e4378c00-6a8d-11ea-97c7-ecda3d5f02d9.png)

#### `bash --posix`
![image](https://user-images.githubusercontent.com/28582702/77185065-f9141f80-6a8d-11ea-94a6-7ddba1c9d0f5.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.