disco icon indicating copy to clipboard operation
disco copied to clipboard

Flag to use only ASCII output

Open byorgey opened this issue 3 years ago • 3 comments

Perhaps the default should be to pretty-print everything using ASCII syntax --- for ease of copy-pasting --- but with an extension to enable pretty-printing with Unicode syntax?

byorgey avatar Jun 27 '21 21:06 byorgey

Nah, copy-pasting is easy enough no matter whether we use ASCII or arbitrary Unicode. Actually, now I am thinking that I like the default of printing things using nice-looking syntax, but we should add a flag to use only ASCII. This is related to #250 --- doing the switch would probably help here.

byorgey avatar Mar 19 '22 14:03 byorgey

We could actually do this pretty easily even without doing #250 --- just add a flag to the read-only context for pretty-printing and use it to select ASCII-only concrete syntax (instead of just using the first thing in the list).

byorgey avatar May 18 '22 17:05 byorgey

One original idea I had was to annotate each terminal with its ASCII equivalent, and select which to use at rendering time. But note that doesn't allow prettyprinter to take the different widths into account. So I think this does just need to look like a flag to the prettyprinter so that it selects which concrete syntax to use.

byorgey avatar Feb 02 '24 12:02 byorgey