Terminal window refresh delays?

Discussion in 'Mac Programming' started by asiga, Nov 7, 2016.

  1. asiga macrumors 6502a

    Joined:
    Nov 4, 2012
    #1
    Not exactly a programming question, but if you use Terminal you're likely a programmer, so I feel it's the best suited subforum:

    Have you noticed the Terminal window having some delay when refreshing stdout/stderr output from command line programs? I'm on 10.11.6 now, and I think it didn't happen in the first El Capitan versions, I believe this lagging came with some 10.11.x update.

    It's a several-seconds delay. I think you cancel the delay when moving the mouse pointer over the Terminal window, then it gets refreshed (or that's my impression).

    Do you experience it? Does it affect Sierra too? Did you fix it somehow?
     
  2. techwarrior macrumors 6502a

    techwarrior

    Joined:
    Jul 30, 2009
    Location:
    Colorado
    #2
    If the delay occurs when first launching Terminal or new tabs, clearing out log files can help:

    sudo rm -rf /private/var/log/asl/*.asl

    Also, on Preferences > Startup tab, specify "Shells Open With" and enter the path for your preferred shell, for instance:

    /bin/bash

    Apparently, the later enables terminal to open without searching for the shell profile.
     
  3. asiga thread starter macrumors 6502a

    Joined:
    Nov 4, 2012
    #3
    It doesn't happen when launching the Terminal window, but when running command-line executables on it. Imagine you have a command line C program that performs some computation and outputs a lot of floating point numbers to stdout. In previous OS X versions, the stdout output was immediate (no matter if the program called fflush(stdio) or not). Now, on 10.11.6 (an perhaps also in some earlier 10.11.x updates but not in the first ones), the program finishes, and after a couple of seconds you see the stdout output. It's like if now there was some buffer awaiting to get flushed (but it doesn't obey to fflush()). As I said, I have the impression that if I move the mouse over the Terminal window, then it flushes the output instantly.
     

Share This Page