AFNI detached from terminal

Hi,

I’m using AFNI for a quite some time now and never had a problem launching the GUI. Just updated the XQuartz and AFNI won’t launch, says the AFNI is detached from the terminal. Those are the outputs of the ‘afni’ command and afni_system_check.py -check_all:


[suntsmabookpro1:~/abin] sunt% afni
Precompiled binary macos_10.12_local: Jan 26 2021 (Version AFNI_21.0.06 'Titus')


** Version check disabled: AFNI_VERSION_CHECK forbids
Thanks go to LR Frank for useful feedback

[b]Initializing: X11++ AFNI is detached from terminal.[/b]


[suntsmabookpro1:~/abin] sunt% afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture:         64bit 
system:               Darwin
release:              20.3.0
version:              Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64
distribution:         10.16
number of CPUs:       16
apparent login shell: tcsh
shell RC file:        .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /Users/sunt/abin/afni
afni version         : Precompiled binary macos_10.12_local: Jan 26 2021 
                     : AFNI_21.0.06 'Titus'
AFNI_version.txt     : AFNI_21.0.06, macos_10.12_local, Jan 26 2021
which python         : /usr/bin/python
python version       : 2.7.16
which R              : /usr/local/bin/R
R version            : R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
which tcsh           : /bin/tcsh

instances of various programs found in PATH:
    afni    : 1   (/Users/sunt/abin/afni)
    R       : 1   (/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R)
    python  : 1   (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
    python2 : 1   (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
    python3 : 2 
      /usr/local/Cellar/python@3.9/3.9.1_4/Frameworks/Python.framework/Versions/3.9/bin/python3.9
      /usr/bin/python3


testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    uber_subject.py      : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    3dMVM                : success

checking for R packages...
    rPkgsInstall -pkgs ALL -check : success

R RHOME : /Library/Frameworks/R.framework/Resources

checking for $HOME files...
    .afnirc                   : found
    .sumarc                   : found
    .afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
** failed to load module PyQt4
-- PyQt4 is no longer needed for an AFNI bootcamp

++ module loaded: matplotlib.pyplot
   module file : /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/pyplot.pyc

-- python binaries under /usr/local/bin:
    /usr/local/bin/python3 (sym link to /usr/local/Cellar/python@3.9/3.9.1_4/Frameworks/Python.framework/Versions/3.9/bin/python3.9)
    /usr/local/bin/python3.9 (sym link to /usr/local/Cellar/python@3.9/3.9.1_4/Frameworks/Python.framework/Versions/3.9/bin/python3.9)

-------------------------------- env vars --------------------------------
PATH = /usr/local/fsl/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:/Library/Apple/usr/bin:/Users/sunt/abin

PYTHONPATH = 
R_LIBS = 
LD_LIBRARY_PATH = 
DYLD_LIBRARY_PATH (sub-shell) = /opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = 

------------------------------ data checks -------------------------------
data dir : found AFNI_data6   under $HOME
           top history: 20 Feb 2020 [rickr]: updated FT_analysis examples
data dir : found AFNI_demos   under $HOME
           top history: 22 Oct 2019 [discoraj]: added Cluster Explorer Demo
data dir : found suma_demo    under $HOME
           top history: ...s_New/data/Build_tmp on Mon Mar  4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas    : found TT_N27+tlrc  under .

------------------------------ OS specific -------------------------------
XQuartz version      : 2.8.0_beta3

which brew           : /usr/local/bin/brew
brew version         : Homebrew 2.7.2

-- for PyQt4 under brew, consider running:
   brew install cartr/qt4/pyqt
-- consider installing gcc under homebrew
-- consider installing glib under homebrew
++ found 1 dylib files under '/opt/X11/lib/flat_namespace'
   -- found 'libXt' dylib files:
      /opt/X11/lib/flat_namespace/libXt.6.dylib
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell 'tcsh'...
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace

=========================  nothing to fix, yay!  =========================

Thanks!

Don’t worry about that. It’s normal. The window is detached, so you can type in the terminal and process other commands. It used to be required that you would have to add an “ampersand” - “&” at the end of the command, but that is no longer required.

Hi Daniel,
Thank you for your response. The problem is that the AFNI GUI is not opening, while other commands do work.

Thanks

Sorry, I didn’t read down to the bottom of the message. You may have to reboot your system for XQuartz to update to the beta 3 version just recently introduced. I will note there were problems on the first beta version that seem to be resolved with the new installation. I’m hoping to make available builds made expressly for the newer OS and XQuartz very, very soon. I haven’t tested the combination myself of XQuartz Beta3 with the Big Sur/MacOS 11 (aka 10.16), just with 10.15 (Catalina).

For now, you can modify your .cshrc file to contain only the one directory in your DYLD_LIBRARY_PATH although having it repeat won’t hurt. Also do the “brew install gcc glib” as the afni_system_check.py recommends.

Hi,
I meet the same question: Initializing: X11++ AFNI is detached from terminal. when I update AFNI and XQuartz. Those are the outputs of the ‘afni’ command and afni_system_check.py -check_all:

-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 19.6.0
version: Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64
distribution: 10.15.6
number of CPUs: 4
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/Shawn/abin/afni
afni version : Precompiled binary macos_10.12_local: Oct 20 2021
: AFNI_21.3.04 ‘Trajan’
AFNI_version.txt : AFNI_21.3.04, macos_10.12_local, Oct 20 2021
which python : /usr/local/bin/python
python version : 2.7.14
which R : /usr/local/bin/R
R version : R version 3.6.3 (2020-02-29) – “Holding the Windsock”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/Shawn/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R)
python : 2
/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
python2 : 2
/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
python3 : 2
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
/usr/bin/python3

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : success
uber_subject.py : success
3dAllineate : success
3dRSFC : success
SurfMesh : success
3dClustSim : success
3dMVM : success

checking for R packages…
rPkgsInstall -pkgs ALL -check : FAILURE

    oo Warning: 
       These packages are not installed on the computer: afex!

R RHOME : /Library/Frameworks/R.framework/Resources

checking for $HOME files…
.afnirc : found
.sumarc : found
.afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
++ module loaded: PyQt4
module file : /usr/local/lib/python2.7/site-packages/PyQt4/init.pyc

** have PyQt4, but cannot load QtCore, QtGui; error is:


Traceback (most recent call last):
File “”, line 1, in
ImportError: cannot import name QtCore


** failed to load module matplotlib.pyplot
– matplotlib.pyplot is not required, but is desirable

– python binaries under /usr/local/bin:
/usr/local/bin/python (sym link to /usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
/usr/local/bin/python3 (sym link to /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6)
/usr/local/bin/python2 (sym link to /usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
/usr/local/bin/python3.6 (sym link to /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6)
/usr/local/bin/python2.7 (sym link to /usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
/usr/local/bin/python3.4 (sym link to /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4)

-------------------------------- env vars --------------------------------
PATH = /usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/Shawn/abin:/Applications/MATLAB_R2016b.app/bin/

PYTHONPATH = /usr/local/lib/python2.7/site-packages

R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH (sub-shell) = /opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = /Users/Shawn/abin

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : found suma_demo under $HOME
top history: …/SUMA_data/Build_tmp on Wed Aug 20 10:04:23 EDT 2014
data dir : found afni_handouts under $HOME
atlas : found TT_N27+tlrc under /Users/Shawn/abin

------------------------------ OS specific -------------------------------
XQuartz version : 2.7.11

which brew : /usr/local/bin/brew
brew version : Homebrew 3.3.2

++ found PyQt4 under /usr/local/lib/python2.7/site-packages
** consider linking /usr/local/Cellar/gcc/11.2.0_1/lib/gcc/11/libgomp.1.dylib under /usr/local/lib
++ found valid link /usr/local/lib/libglib-2.0.dylib
to …/Cellar/glib/2.70.1/lib/libglib-2.0.dylib
++ found 1 dylib files under ‘/opt/X11/lib/flat_namespace’
– found ‘libXt’ dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
– recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell ‘bash’…
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace
– recent OS X, cheating to check DYLD_LIBRARY_PATH in shell ‘tcsh’…
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace

========================= summary, please fix: =========================

  • just be aware: login shell ‘bash’, but our code examples use ‘tcsh’
  • shell bash: consider sourcing (non-login) .bashrc from (login) .bash_profile
  • missing R packages (see rPkgsInstall)
  • check for partial install of PyQt4
  • insufficient data for AFNI BootCamp

and I tried to fix the problems of R packages missing and reinstall PyQt4, but failed.
Thanks

The previous question was about starting the AFNI GUI. The GUI did not appear as an X window. Are you seeing the same thing? The R and PyQt4 issues are probably unrelated.

yes, yes, I can’t start the AFNI GUI. The XQuartz can launch, but the GUI did not appear as an X window

Do you get an error, or does AFNI just disappear? For the disappearing AFNI case, there is a bug in XQuartz on some computers with 2 monitors. Configuring the monitors to either mirror each other or changing the left-right order is the workaround for that problem.

the terminal didn’t report any error, And the AFNI just don’t appear. I run AFNI in my MacBook, with no other monitors.
the following is the output of ‘afni’ command:

[shawn-2:~] Shawn% afni
Precompiled binary macos_10.12_local: Oct 20 2021 (Version AFNI_21.3.04 ‘Trajan’)

** Version check disabled: AFNI_VERSION_CHECK forbids
Thanks go to K Kuhns for caloric input

Initializing: X11++ AFNI is detached from terminal.
[shawn-2:~] Shawn%

Hi Shawn,

It might be preferable to run afni via “afni -no_detach”, just to avoid confusion from the sub-process.

Are there afni processes running now? Check the output from:

ps aux | grep afni

I am not sure if it matters, but have you rebooted or logged out since updating XQuartz?

  • rick

Hmm, interesting. Are you running AFNI locally on your Mac?

Maybe there is an interaction with the MacOS Spaces. Turn that off or use just one Space if it’s on.

Another slim possibility is that you have a strange AFNI_LAYOUT_FILE set in your ~/.afnirc or as an environment variable.

hi, I tried “afni -no_detach”, mmm, this command doesn’t work. the AFNI GUI still doesn’t appear. the other command like 3dcalc is ok
I have rebooted the Mac, and I find there is a problem with XQuatz, it can’t be closed after launch until the mac is rebooted or logged out.

and the output of “ps aux | grep afni” is:

gre: Command not found.

yes I run AFNI locally on my Mac.
I agree with this idea of MacOS spaces. I have two accounts on my MacBook. is this the reason?

the following is the content of .afnirc file:

// This is a sample .afnirc file.
// Copy it into your home directory, with the name ‘.afnirc’.
// Then edit it to your heart’s delight.
// See README.setup and README.environment for documentation.

***COLORS
// Define new overlay colors. These will appear on the color menus.

salmon = #ff8866
navy = navyblue

***ENVIRONMENT

// Most (not all) of the Unix environment variables that affect AFNI

IDCODE_PREFIX = AFN // 3 letter prefix for dataset ID codes

// AFNI_graph_boxes_thick = 0 // for graph box lines: 0=thin, 1=thick
// AFNI_graph_grid_thick = 0 // ditto for the graph vertical grid lines
AFNI_graph_data_thick = 1 // ditto for the data graphs
AFNI_graph_ideal_thick = 1 // ditto for the ideal graphs
AFNI_graph_ort_thick = 1 // ditto for the ort graphs
AFNI_graph_dplot_thick = 1 // ditto for the dplot graphs
AFNI_graph_ggap = 3 // initial spacing between graph boxes
AFNI_graph_width = 512 // initial width of graph window
AFNI_graph_height = 384 // initial height of graph window
// AFNI_graph_matrix = 3 // initial number of sub-graphs
AFNI_GRAPH_TEXTLIMIT = 20 // max number of rows shown in Graph popup
// AFNI_GRAPH_BASELINE = Individual // baseline type set in Graph windows
// AFNI_GRAPH_GLOBALBASE = 0 // Global baseline value in Graph windows

// AFNI_montage_periodic = True // allows periodic montage wraparound
// AFNI_purge = True // allows automatic dataset memory purge

// AFNI_resam_vox = 1.0 // voxel dimension (mm) for resampled dsets
// AFNI_resam_anat = Li // {NN|Li|Cu|Bk} for Anat resampling mode
// AFNI_resam_func = NN // ditto for Func resampling mode
// AFNI_resam_thr = NN // for Threshold resampling mode

// AFNI_pbar_posfunc = True // will start color pbar as all positive
// AFNI_pbar_sgn_pane_count = 8 // init # of panes for signed color pbar
// AFNI_pbar_pos_pane_count = 8 // init # of panes for positive color pbar
// AFNI_pbar_hide = True // hide color pbar when it is being altered
// AFNI_PBAR_IMXY = 200x20 // size of saved pbar color image
// AFNI_PBAR_LOCK = YES // lock color pbars together
// AFNI_OVERLAY_ZERO = NO // YES==colorize zeros in Overlay dset

// AFNI_THRESH_LOCK = YES // lock threshold sliders together
// AFNI_THRESH_AUTO = YES // YES==AFNI guesses a threshold
// AFNI_SLAVE_FUNCTIME = NO // YES==time index changes olay AND ulay
// AFNI_SLAVE_THRTIME = NO // YES==time index changes threshold, too

// AFNI_COLORSCALE_DEFAULT = Spectrum:red_to_blue // init colorscale for pbar

// AFNI_chooser_listmax = 20 // max items in chooser before scrollbars used
// AFNI_MAX_OPTMENU = 999 // max # items in an ‘option menu’
// AFNI_DONT_MOVE_MENUS = YES // don’t try to move popup menu windows
// AFNI_MENU_COLSIZE = 30 // max number of entries in a popup menu col
// AFNI_DISABLE_TEAROFF = NO // YES==disable the menu ‘tearoff’ capability

// AFNI_DONT_SORT_ENVIRONMENT = NO // YES==disable sorting Edit Environment
// AFNI_ORIENT = RAI // coordinate order
// AFNI_NOPLUGINS = NO // YES==disable plugins
// AFNI_YESPLUGOUTS = NO // YES==enable plugouts (POs)
// AFNI_PLUGOUT_TCP_BASE = 6666 // overrides def TCP/IP socket for plugouts

// AFNI_PLUGINPATH = /home/rwcox/abin // dir for plugins
// AFNI_TSPATH = /home/rwcox/stuff // dir for .1D files
// AFNI_MODELPATH = /home/rwcox/abin // dir for NLfim models
// TMPDIR = /tmp // dir for temporary files
// AFNI_GLOBAL_SESSION = /data/junk // dir w/ dsets you always see

// AFNI_BYTEORDER = LSB_FIRST // to force .BRIK byte order on output
// AFNI_BYTEORDER_INPUT = LSB_FIRST // when .HEAD file fails to specify
// AFNI_NO_BYTEORDER_WARNING = YES // do NOT print byte-ordering warning

AFNI_SESSTRAIL = 1 // # of directory levels to show in filenames
AFNI_HINTS = YES // YES==turns on popup hints
// AFNI_COMPRESSOR = GZIP // force all .BRIK output to be compressed
AFNI_AUTOGZIP = YES // gzip .BRIK files if it’s a good idea
// AFNI_NOMMAP = YES // to disable use of mmap() file I/O
AFNI_LEFT_IS_LEFT = YES // YES==show human left on screen left
// AFNI_ENFORCE_ASPECT = YES // AFNI to enforce image aspect ratio
AFNI_ALWAYS_LOCK = YES // to start with all AFNI controllers locked
// AFNI_NOREALPATH = NO // don’t convert filenames to ‘real’ names
// AFNI_NO_MCW_MALLOC = NO // YES==turn off debugging malloc use
AFNI_FLOATSCAN = YES // YES==scan float datasets for errors

// AFNI_NOSPLASH = NO // YES==turn off the AFNI splash window
AFNI_SPLASH_XY = 444:222 // x:y coordinates for splash window
// AFNI_SPLASHTIME = 3 // how many seconds splash window stays up
// AFNI_SPLASH_MELT = NO // whether to use the ‘melt’ effect

// AFNI_NOTES_DLINES = 11 // # of text entry lines in the Notes plugin
// AFNI_MARKERS_NOQUAL = NO // YES==AFNI won’t do ‘quality’ for markers
AFNI_NO_ADOPTION_WARNING = YES // YES==don’t show dset ‘adoption’ warnings
AFNI_VIEW_ANAT_BRICK = YES // try to view data without warp-on-demand
AFNI_VIEW_FUNC_BRICK = YES // try to view data without warp-on-demand
AFNI_tsplotgeom = 512x384 // size of time series plot windows
AFNI_PLUGINS_ALPHABETIZE = YES // whether to alphabetize Plugins menu
// AFNI_VOLREG_EDGING = 5 // size of edge region masked out in 3dvolreg
// AFNI_ROTA_ZPAD = 5 // size of zero padding to use in 3dvolreg

AFNI_ncolors = 80 // # of gray levels to use in underlay
AFNI_gamma = 1.7 // gamma correction for ulay intensities
AFNI_GRAYSCALE_BOT = 25 // min image intensity graylevel (0-255)
AFNI_IMAGE_MINFRAC = 0.04 // minimum size of AFNI image window
AFNI_IMAGE_MAXFRAC = 0.88 // maximum size of AFNI image window
// AFNI_IMAGE_MINTOMAX = NO // YES=start Image win in Min-to-Max mode
// AFNI_IMAGE_CLIPPED = NO // YES=start Image win in Clipped mode
// AFNI_IMAGE_CLIPBOT = 0.25 // bottom level scaling for Clipped mode
// AFNI_IMAGE_CLIPTOP = 1.0 // top level scaling for Clipped mode
// AFNI_IMAGE_GLOBALRANGE = NO // YES=scale Image grayleves in 3D
AFNI_KEEP_PANNING = YES // keep Pan mode on in Image windows
// AFNI_IMAGE_LABEL_MODE = 1 // draw labels in upper left of Image wins
// AFNI_IMAGE_LABEL_SIZE = 2 // size of labels in Image windows
// AFNI_IMAGE_LABEL_COLOR = white // color of labels in Image windows
// AFNI_IMAGE_LABEL_SETBACK = 0.01 // distance from edges for labels
// AFNI_CROSSHAIR_LINES = YES // draw crosshairs with lines, not voxels
// AFNI_CROP_ZOOMSAVE = NO // how to save zoomed Image windows
// AFNI_IMAGE_ZEROCOLOR = white // color of 0 voxels in Image window
// AFNI_IMAGE_ENTROPY = 0.2 // image entropy for disabling 2%-to-98%
AFNI_IMAGE_ZOOM_NN = YES // NO=linearly interpolate zoomed imgs
AFNI_ZOOM_LOCK = YES // NO=don’t lock zoomed in panels
// AFNI_IMAGE_SAVESQUARE = NO // YES=always save images with sq pixels
// AFNI_IMAGE_TICK_DIV_IN_MM = NO // YES=image tick mark spacings are in mm
// AFNI_IMAGRA_CLOSER = NO // YES=Image/Graph button 2nd click closes
AFNI_DEFAULT_OPACITY = 8 // default opacity level for Image windows
AFNI_DEFAULT_IMSAVE = jpg // default Image window Save format
// AFNI_OLD_PPMTOBMP = NO // YES==color quantize BMP output images
AFNI_VIDEO_DELAY = 66 // ms between ‘v’ key image cycling
// AFNI_STROKE_THRESHOLD = 8 // min mouse movement for grayscale edit
// AFNI_STROKE_AUTOPLOT = YES // YES=show grayscale histogram in edit
// AFNI_NO_SIDES_LABELS = NO // YES==AFNI won’t show ‘left=Left’ labels

// AFNI_MINC_DATASETS = YES // try to read .mnc files as datasets
// AFNI_MINC_FLOATIZE = YES // convert .mnc files to floats on input
// AFNI_MINC_SLICESCALE = YES // scale each .mnc slice separately
// AFNI_ANALYZE_DATASETS = YES // read ANALYZE-7.5 files as datasets
// AFNI_ANALYZE_FLOATIZE = YES // convert ANALYZE data to floats on input
// AFNI_ANALYZE_SCALE = YES // use the ‘funused1’ value for scaling
// AFNI_ANALYZE_ORIGINATOR = YES // use the SPM ORIGINATOR field
// AFNI_ANALYZE_ORIENT = LPI // orientation for ANALYZE datasets
// AFNI_ANALYZE_AUTOCENTER = NO // make center of file have (x,y,z)=(0,0,0)?
// AFNI_MPEG_DATASETS = NO // YES==try to read .mpg files as datasets
// AFNI_MPEG_GRAYIZE = NO // YES==convert .mpg datasets to grayscale

// AFNI_START_SMALL = NO // set initial AFNI dataset to smallest one
AFNI_DISP_SCROLLBARS = YES // YES==show scrollbars on Disp panel
// AFNI_VALUE_LABEL = YES // show data value label in Define Overlay

// AFNI_SUMA_LINECOLOR = blue // color for surface lines from SUMA
// AFNI_SUMA_LINESIZE = 2 // thickness of lines from SUMA
// AFNI_SUMA_BOXSIZE = 3 // size of node boxes from SUMA
// AFNI_SUMA_BOXCOLOR = yellow // color for node boxes from SUMA
// AFNI_SHOW_SURF_POPUPS = NO // YES=see info wins of SUMA data xfers
// AFNI_KILL_SURF_POPUPS = NO // YES=don’t see info from SUMA data xfers

// AFNI_LOAD_PRINTSIZE = 100M // print warning when large file is loaded
// AFNI_VERSION_CHECK = YES // NO=disable weekly version check over Web
// AFNI_MOTD_CHECK = YES // NO=disable display of Message-of-the-Day
// AFNI_AGIF_DELAY = 10 // centi-seconds b/t animated GIF frames
// AFNI_MPEG_FRAMERATE = 24 // MPEG-1 frame rate for saved movies

// AFNI_SLICE_SPACING_IS_GAP = NO // YES==fix GE DICOM error
// AFNI_DICOM_RESCALE = NO // YES==use DICOM rescale tags
// AFNI_DICOM_WINDOW = NO // YES==use DICOM window tags

// AFNI_RESCAN_METHOD = Add // add new datasets, don’t replace old ones
// AFNI_STARTUP_WARNINGS = YES // NO==turn off some warning msg at startup
// AFNI_1D_TIME = NO // YES==.1D files columns are the time axis
// AFNI_1D_TIME_TR = 1.0 // value for TR of a .1D time file
// AFNI_3D_BINARY = YES // YES==save .3D files in binary format
// AFNI_DRAW_UNDOSIZE = 4 // # Mbytes for Draw Dataset undo buffer

// AFNI_DISABLE_CURSORS = NO // YES==don’t try to change X11 cursors
// AFNI_CLICK_MESSAGE = NO // YES=see ‘click here to pop down’ msg
// AFNI_X11_REDECORATE = YES // NO==don’t try to change X11 win controls
// AFNI_MAX_1DSIZE = 66666 // max size of .1D files to auto-read
// AFNI_TITLE_LABEL2 = NO // YES==use dset ‘label2’ field in titlebar
// AFNI_EDGIZE_OVERLAY = NO // YES==show only edges of color olay blobs
AFNI_DONT_LOGFILE = YES // NO==do log AFNI progs to ~/.afni.log
// AFNI_WRITE_NIML = NO // YES==write .HEAD files in NIML format
// AFNI_TTATLAS_CAUTION = YES // NO==disable warning message in ‘wherami’
// AFNI_RESCAN_AT_SWITCH = YES // YES=rescan directory for new datasets
// AFNI_DATASET_BROWSE = YES // YES=dset item selection acts immediately
// AFNI_OVERLAY_ONTOP = YES // YES=‘Overlay’ button above ‘Underlay’

// AFNI_NIML_START = YES // start NIML listening when AFNI starts
// NIML_TRUSTHOST_01 = 192.168.0.1 // IP address of trusted host for NIML

AFNI_plug_drawdset_butcolor = #992066 // For the Plugins menu.
// AFNI_plug_histog_butcolor = #663199 // Colors are drawn from
AFNI_plug_crender_butcolor = #cc1033 // the RBGCYC map in afni.h

// AFNI_hotcolor = navyblue // color for ‘Done’, ‘Set’, etc.

// AFNI_NO_NEGATIVES_WARNING = NO // YES==to3d won’t warn about negative vals
// AFNI_TO3D_ZPAD = 0 // # of zero padding slices to add in to3d
// AFNI_TRY_DICOM_LAST = NO // YES=DICOM is last img format tried in to3d
// AFNI_ALLOW_MILLISECONDS = NO // YES==allow ‘ms’ time units in to3d

// AFNI_STARTUP_SCRIPT = /home/rwcox/.afni_script // script run at AFNI start

AFNI_ONE_OBLIQUE_WARNING = YES // In afni GUI, just one oblique warning

AFNI_GRAPH_FORCE_AUTO_SCALE = YES // Autoscale graphs each time redrawn
AFNI_AUTORANGE_PERC = 95 // autorange for non-ROI olays, from data

You probably mistyped the ps command line. That checks to see if afni is running even if you can’t see it.

The .afnirc file looks fine. Reinstall XQuartz. The latest version is 2.8.1. After reinstalling, reboot your computer. Try running simple X11 applications like xclock or xeyes. Then run afni.

I update the XQuartz and reboot. It works(tu)(tu) .Thanks very much!!!

the output of command ps is :
Shawn 1254 0.0 0.0 4268284 668 s000 S+ 9:33AM 0:00.00 grep afni
Shawn 1244 0.0 1.6 4469708 135220 s020 S 9:31AM 0:01.28 afni