Skip to content
This repository has been archived by the owner on Jul 30, 2023. It is now read-only.

feat: colorize only ttys #1

Merged
merged 1 commit into from Oct 11, 2020

Conversation

denysvitali
Copy link
Contributor

@denysvitali denysvitali commented Oct 11, 2020

Usually kubectl is also used in aliases such as the ones
available as zsh plugins (https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/kubectl/kubectl.plugin.zsh).

Unfortunately if you alias k to kubecolor, you won't be able to get commands such as kcn to work because the output in the subshell will be colorized as well.

This commit checks whether the user is running the command in a TTY, and returns the colorized version only in this case, so that kubecolor and kubectl subshell commands can coexist.


Example:
20201011_12h28m16s_grim

Usually kubectl is also used in aliases such as the ones
available as zsh plugins
(https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/kubectl/kubectl.plugin.zsh).

Unfortunately if you alias k to kubecolor, you won't be able
to get commands such as `kcn` to work because the output in
the subshell will be colorized as well.

This commit checks whether the user is running the command
in a TTY, and returns the colorized version only in this case,
so that kubecolor and kubectl subshell commands can coexist.
Copy link
Owner

@hidetatz hidetatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@hidetatz hidetatz merged commit ba1cd2c into hidetatz:main Oct 11, 2020
@denysvitali denysvitali deleted the feature/colorize-only-ttys branch October 11, 2020 19:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants