Skip to content

Shellac Protocol Proposal V2

andychu edited this page May 22, 2019 · 8 revisions

Requirements

  • Shell-agnostic. You can't force zsh to parse bash strings!
  • Compatible with existing completion scripts. e.g. _openstack use case
  • The minimal thing that solves these requirements.

Design Sketch

Compared to the original Shellac Protocol Proposal

  • Remove mention of coprocesses! That is orthogonal. It's just a process now.
  • Input side:
    • shellac-provider -- command --myflag 1 --myflag2 f
  • Output:
    • { key, value, key, value } in NUL terminated strings
    • Arrays are prefixed with length

Example:

["candidates", "2", "one", "two", "descriptions", "2", "desc1", "desc2"]

This is printed on stdout as a series of NUL-terminated strings.

  • Read with read -d $'\0' in bash

What's Wrong with complete -C in bash?

  • line-oriented protocol
  • COMP_CWORDS is wrong

TODO: Write up more!

Clone this wiki locally