jmespath / jmespath/jmespath.terminal

Investigate why jpterm hangs when used in command substitution

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
478
Forks
65
PR merge metrics
No merged PRs in 30d

Description

jpterm does not work and will just hang when used with `$(...)`. For example, this works:

```
echo '"foo"' | jpterm
```

But this will not:

```
echo $(echo '"foo"' | jpterm)
```

I'll need to investigate if this is just a limitation in urwid, or if there's something in jpterm.py I can do to enable this scenario. This would enabled things like:

```
aws s3api delete-objects --bucket foo --delete "$(aws s3api list-object-versions --bucket foo | jpterm)"
```

So you could get the JSON structure right by messing around in jpterm, and then that result would then be used as the JSON input structure for the `--delete` arg.

Traceback (which occurs when I try to Ctrl-C out):

```
$ echo $(echo '"foo"' | jpterm)
Traceback (most recent call last):
File "/usr/local/bin/jpterm", line 6, in
jpterm.main()
File "/usr/local/lib/python2.7/site-packages/jpterm.py", line 194, in main
display.main(screen=screen)
File "/usr/local/lib/python2.7/site-packages/jpterm.py", line 137, in main
self.loop.run()
File "/usr/local/lib/python2.7/site-packages/urwid/main_loop.py", line 278, in run
self.screen.run_wrapper(self._run)
File "/usr/local/lib/python2.7/site-packages/urwid/raw_display.py", line 272, in run_wrapper
return fn()
File "/usr/local/lib/python2.7/site-packages/urwid/main_loop.py", line 343, in _run
self.event_loop.run()
File "/usr/local/lib/python2.7/site-packages/urwid/main_loop.py", line 673, in run
self._loop()
File "/usr/local/lib/python2.7/site-packages/urwid/main_loop.py", line 697, in _loop
ready, w, err = select.select(fds, [], fds)
KeyboardInterrupt
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.