How do I make processes think output is to a terminal?

Viewed 61

I'm writing a Go program that pipes command output (which the user enters) through another command (lolcat). However, when I use this program to run vim, it complains that the output is not to a terminal:

Vim: Warning: Output is not to a terminal

Other programs are also able to detect that output is being piped. Is there a way to fool all processes into thinking that they're outputting to a terminal?

Is it possible that code similar to this section of code could help: https://github.com/cipriancraciun/z-run/blob/master/sources/lib/input.go#L52-L58? (this isn't my repo)

Here's the relevant piece of code I'm using right now: https://github.com/quackduck/lolsh/blob/main/lolsh.go#L209-L263

0 Answers
Related