0

When I m using iTerm 2 (with zsh), and a command is running at the prompt, every minute or so ^@ (NULL character) got displayed on the terminal. Below is an example, using socat, but other commands yield the same outcome:

2016/03/11 09:59:36 socat[1514] D data loop: sock1->eof=0, sock2->eof=0, closing=0, wasaction=1, total_to={0.000000} 2016/03/11 09:59:36 socat[1514] D select(8, &0xa0, &0x0, &0x0, NULL/0.000000) ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@

In this example, ^@ is written at the end of the last line every minute or so.

If I run the same command with the built in mac os Terminal app / bash, the output is clean.

Any idea where these nulls characters comes from and how to get rid of it?

  • Are you using a zsh theme? Some themes require powerline patched fonts to display special characters. – JavoSN Mar 11 '16 at 19:14
  • I'm using oh-my-zsh with robbyrussell default theme – Malakof Mar 11 '16 at 19:42
  • Might be a font issue, then. I suggest installing a powerline font from github.com/powerline/fonts and checking if the issue is solved. – JavoSN Mar 11 '16 at 19:45
  • Ok Javo,I tried it by installing AnonymousPro from powerline fonts in Font Book (any other steps required?) and i've still got the ^@ coming out – Malakof Mar 12 '16 at 18:37
  • You should just just add the font file to your /Users/Your_Username/Library/Fonts folder, then in terminal go to Preferences, Profiles, Text, and set both fonts to your new patched font (for your active profile. You should see the font change in your iTerm window. – JavoSN Mar 14 '16 at 13:44
2

Null characters are anti-idle feature to keep connection alive with old servers.

Go to iTerm2 -> Preferences -> Profiles -> [select your profile] -> Session tab -> uncheck "When idle, send ASCII code" checkbox.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .