Apparently I've configured some kind of utility that makes my whole screen flash white whenever my Terminal.app gives a 'bell'. This is not the same as the option "visual bell" on the preference pane of Terminal. Does anyone know how I can deactivate this behavior? It's pretty annoying.
Macos – White flash of screen in Terminal
macosterminal.app
Related Solutions
screen and Environment Variables
By default, screen passes along to its shells (and other processes) whatever environment variables it had when the session was started (i.e. reconnecting does not change which environment variables are given to new shells). But because both screen and shells' configuration files commonly change environment variables, there are many places where unexpected changes can be introduced. There are a few variables, like TERM, that screen it almost always changes, but these are generally required for the functionality that screen provides.
Let's say that neither your shell's configuration, nor screen's configuration will modify a variable named FOOBAR (fairly likely, all in all). If you start a session with FOOBAR=foo screen
, then all the shells created in that session will have an environment variable named FOOBAR with a value of foo
.
Things get more complicated for variables that either screen or your shell might modify.
Missing Settings When Using screen
Login Shells
If you find that some settings are missing in shells started by screen, it may be because your shell is configured only to update those settings for ‘login’ shells. Most shells understand a special convention (in C: **argv == '-'
) that screen can be configured to use.
Per the screen documentation:
shell command
Set the command to be used to create a new shell. This overrides the value of the environment variable $SHELL. This is useful if you'd like to run a tty-enhancer which is expecting to execute the program speci- fied in $SHELL. If the command begins with a '-' character, the shell will be started as a login-shell.
To have screen start shells as ‘login’ shells, start screen with screen -s -/bin/bash
, or add this line to your .screenrc
:
shell -/bin/bash
Adjust for the path to whatever shell you happen to be using.
screen Configuration
Missing or reset environment variables could also be due to setenv
and unsetenv
commands in a screen configuration file. You will have to check both the .screenrc in your home directory and whichever file your compilation of screen is using as the ‘system screenrc’ (you might try a command like strings "$(which screen)" | fgrep -i screenrc
to find the pathname that was configured at compile time–it is usually /etc/screenrc for a system-installed screen; add-on installations will probably use some other pathname). You can use SCREENRC=/dev/null SYSSCREENRC=/dev/null screen
to temporarily avoid these settings files, but there is a compile-time option that prevents the effective use of SYSSCREENRC (presumably so that system administrators can force some bit of initial configuration).
Duplicate Settings When Using screen
It is fairly common to add items to an environment variable like PATH in a shell's configuration file(s) so that the updated value is available to normal shell sessions (e.g. xterm or other terminal windows, console sessions, etc.). If such items are added in a shell's per-shell configuration (or, if you are using the -/path/to/shell
setting described above, in the shells per-login configuration) then the shell started by screen will likely have multiple copies of the added items.
One strategy to avoid this is to put all additions to variables like PATH in the per-login configuration of your shell and avoid using the -/path/to/shell
shell setting with screen.
Another strategy is to only conditionally add the new items to the variable. Depending on the shell, the code to do this can be a bit complicated, but it can usually be encapsulated in a shell function for easy use.
Yet another strategy is to always start with a fixed value in your configuration files. This can sometimes cause problems when moving your configuration files from system to system when the default values might vary significantly.
Diagnostics
If you can not directly spot where a particular modification is happening, you can try the following to track down where the change is happening.
Check the current value in your initial shell:
echo "$PATH"
Check how the shell itself modifies the value when a sub-shell is created:
/bin/bash -c 'echo "$PATH"'
Check how the shell modifies the value when a ‘login’ sub-shell is created:
perl -e '$s=shift;exec {$s} "-$s", @ARGV or die "unable to start shell"' /bin/bash
echo "$PATH"
exit
Check how screen modifies the value:
printf '#!/bin/sh\nl=/tmp/echo-var.log;rm -f "$l"; echo $PATH >"$l"' >/tmp/echo-var &&
chmod a+x /tmp/echo-var &&
screen -s /tmp/echo-var &&
cat /tmp/echo-var.log
I solved the problem (and thus posting as an answer instead of amending the question):
The BSD files are indeed not listed in Directory Utility, nor in dscacheutil any more, but at least /etc/hosts is still read, but there is a problem in that multiple host names per IP address don't seem to be supported anymore or at least, they don't work right ATM.
When your old /etc/hosts could have looked like
127.0.0.1 localhost foo foobar
This would cause the ~10 second wait time to resolve any of these host names.
But if you use
127.0.0.1 localhost
127.0.0.1 foo
127.0.0.1 foobar
Resolution will be instant.
RedGrittyBrick's answer is also valid, but I specifically want to continue to use the hosts file over modifying the local directory as it's shared between various development machines of mine.
To answer the rest of my questions too (now all is clear to me):
- The cache resolution order you configure in the directory utility where you can tell it which of the enabled directories you want to look at in what order.
- To configure directories, also use the directory utility
- The directory utility is launched by going to System Preferences > Accounts > Login Options > Join Directory > Directory Utility
- In Lion, the BSD Files "directory" isn't available any more even though the help file still refers to it
- As I said, /etc/hosts is still read, but there's the bug I described above.
Best Answer
You probably have the “flash the screen on alerts” hearing assistance feature turned on.
Try searching for “flash screen” in System Preferences (it should be in the Universal Access preference pane, probably under Hearing).