patchmake - Patches: patch #6911, Ability to detect interactive...


You are not allowed to post comments on this tracker with your current authentication level.

patch #6911: Ability to detect interactive shell (isatty())

Submitted by:  Mark <mtrinh>
Submitted on:  Tue 08 Sep 2009 04:46:16 PM UTC  
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Fixed Release:  None

Sun 13 Sep 2009 07:02:55 PM UTC, comment #3:

sorry, it should be like this:

ifeq "$(MAKE_ISSATTY)" "1"

@echo "\033[33mHi\033[0m"


@echo "Hi"


Mark <mtrinh>
Sun 13 Sep 2009 05:00:23 PM UTC, comment #2:

It's useful when we are outputting colors in the terminal during a build.  For example, the below code would only output colors when it is in an interactive terminal.  If you redirect the output to a file, then it wont output the escape characters in your file. (not sure if the "ifeq" statement is written correctly. :) Hope this helps.

gmake vs gmake > out.txt

ifeq "$(MAKE_ISSATTY)" "1"

      @echo "\033[33mHi\033[0m"


      @echo "\033[33mHi\033[0m"


Mark <mtrinh>
Sat 12 Sep 2009 10:35:59 PM UTC, comment #1:

Can you give me some idea of why this is useful information / what it's useful for?  Thanks!

Paul D. Smith <psmith>
Project Administrator
Tue 08 Sep 2009 04:46:16 PM UTC, original submission:

There are times where I need to figure out if the current shell is interactive or not.  This patch introduces an environment macro called MAKE_ISATTY, which returns either a 1 or 0.

This calls isatty on stdout to figure out if you are redirecting make to a file (ie. make > foo) or not.

This patch is off of the version from CVS.

Mark <mtrinh>


Attached Files
file #18689:  tty.patch added by mtrinh (600B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by mtrinh (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-09-08 mtrinh Attached File- => Added tty.patch, #18689

    Back to the top

    Powered by Savane 3.4