Open
Conversation
This is for decoupling third party Mozc clients such as uim and Fcitx5. See also google#1362 (comment) as a related discussion. This just: 1. accepts mozc.commands.Input as input from stdin, 2. sends the input to mozc_server as-is, 3. receives mozc.commands.Output as output from mozc_server and 4. outputs the output to stdout. This may convert the protobuf binary format to/from something such as JSON Lines. This PoC just implements JSON Lines input/output. (No the protobuf binary format support.) mozc_emacs_helper manages a client pool but this doesn't manage a client pool. If users need it, they must spawn multiple mozc_client_cli processes by themselves. If there is any input error, mozc_client_cli exits with non-0 (1 in this implementation). Users can get error message from stderr. Example: ```console $ bazel-bin/unix/cli/mozc_client_cli {"type": "GET_CONFIG"} {"id":"0",...(GET_CONFIG response in JSON)} {"type": "CREATE_SESSION"} {"id":"1968337769025405287"} ^D $ ``` ```console $ bazel-bin/unix/cli/mozc_client_cli "X" Failed to parse an input JSON as mozc.commands.Input: <"X">: INVALID_ARGUMENT: invalid JSON in mozc.commands.Input, near 1:1 (offset 0): unexpected character: '"'; expected '{' $ echo $? 1 ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a CLI client command.
This is for decoupling third party Mozc clients such as uim and Fcitx5.
Mozc doesn't provide a client library. So third party Mozc clients can't be implemented without bundling Mozc. If we provide a CLI client command, third party Mozc clients can be implemented out of Mozc source.
This just:
This may convert the protobuf binary format to/from something such as JSON Lines. This PoC just implements JSON Lines input/output. (No the protobuf binary format support.)
mozc_emacs_helper manages a client pool but this doesn't manage a client pool. If users need it, they must spawn multiple mozc_client_cli processes by themselves.
If there is any input error, mozc_client_cli exits with non-0 (1 in this implementation). Users can get error message from stderr.
Issue IDs
#1362 (comment) as a related discussion.
Steps to test new behaviors (if any)
A clear and concise description about how to verify new behaviors (if any).
bazelisk build package --config oss_linux --config release_buildbazel-bin/unix/cli/mozc_client_climozc.commands.Inputas JSON Lines to stdinExample:
Additional context
This is just a PoC to discuss this direction.