ArthurSonzogni / json-tui

A JSON terminal UI made in C++
MIT License
334 stars 14 forks source link

Resize to full terminal screen #9

Closed Dentrax closed 2 years ago

Dentrax commented 2 years ago

Thanks for such a great tool! I've been trying to give some feedback.


Like how fx already does, we can resize the output to full terminal screen by passing a flag or by default.

Current behavior: Screen Shot 2022-01-11 at 12 00 30

Press q to exit. Wdyt?

ArthurSonzogni commented 2 years ago

Thanks for such a great tool! I've been trying to give some feedback.

Thanks!

Like how fx already does, we can resize the output to full terminal screen by passing a flag or by default.

It is just a matter of swapping: https://github.com/ArthurSonzogni/json-tui/blob/5a223aab989d7d46cd59e68c3c2dec7b7eea1168/src/main.cpp#L217 into:

  auto screen = ScreenInteractive::Fullscreen();

I see the ability to display the json inline to be a feature. I don't mind adding the capability to do both. Do you think I should allow users to configure it? Maybe a config.json file or some flags.

.config/json-tui/config.json
{
  "display": "fullscreen",
  "colors": {
    "number": "red",
    "string": { "r": 255, "g": 0, "b": 0}
    "boolean": { "h": 255, "s": 0, "v": 0}
  },
  "key": {
    "quit": "q"
  },
  "autoexpand-depth": {
    "object": 1
    "array": 0
  }
}

Press q to exit. Wdyt?

Haha, yes, that would be nice indeed!

Dentrax commented 2 years ago

Maybe a config.json file or some flags.

config.json would be a bit overengineering in this context. Probably passing a flag better idea.

I see the ability to display the json inline to be a feature.

If you want to display the JSON inline by default, then we can add smth --fullscreen flag to change ScreenInteractive mode.