Skip to content

Make users explicitly supply --stdin flag to workspace command when stdin is used #1683

@nikitabobko

Description

@nikitabobko

Excerpt from documentation:

2. (next|prev) syntax
Focuses next or previous workspace in the list.

  • If stdin is not TTY and stdin contains non whitespace characters then the list is taken from stdin
  • Otherwise, the list is defined as all workspaces on focused monitor in alphabetical order

The implicit "is TTY" check is a bad idea. Not every environment closes the stdin if it's not used, which makes aerospace CLI client hang indefinitely (e.g., it happens in nodeJS #1682, #972)

Current behavior:

$ echo -e "foo\nbar" | aerospace workspace next # Works

$ aerospace workspace next # Works

Suggested behavior:

$ echo -e "foo\nbar" | aerospace workspace next # Doesn't work anymore
error: implicit stdin is detected (stdin is not TTY). Implicit stdin was forbidden in AeroSpace v0.20.0
1. Please supply '--stdin' flag to make stdin explicit and preserve old AeroSpace behavior
2. You can also use '--no-stdin' flag to behave as if no stdin was supplied
Breaking change issue: https://github.com/nikitabobko/AeroSpace/issues/1683

$ aerospace workspace next # Still works

All the same is applicable to move-node-to-workspace command

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions