XeFM automatically detects and displays changes made to files by external applications. When another program creates, deletes, modifies, or renames files in the directory you’re viewing, XeFM updates the file list automatically—no manual refresh needed.
This feature keeps your view synchronized with the actual filesystem state, preventing confusion and potential errors from working with outdated information.
XeFM monitors both the left and right pane directories simultaneously. When an external application makes changes:
Your cursor position and selection are preserved during automatic updates, so your workflow isn’t interrupted.
Automatic file monitoring is enabled by default. To change this setting, edit your XeFM configuration file (~/.xefm/config.py) and set the constant on the Config class:
FILE_MONITORING_ENABLED = True
Set FILE_MONITORING_ENABLED to False to disable automatic monitoring. When disabled, XeFM only updates the file list after you perform actions like navigating directories or manually refreshing.
Most users won’t need to adjust these settings, but they’re available in ~/.xefm/config.py for fine-tuning:
FILE_MONITORING_ENABLED = True # Enable/disable automatic reloading
FILE_MONITORING_COALESCE_DELAY_MS = 200 # Event coalescing window (milliseconds)
FILE_MONITORING_MAX_RELOADS_PER_SECOND = 5 # Maximum reloads per second (rate limiting)
FILE_MONITORING_FALLBACK_POLL_INTERVAL_S = 5 # Polling interval for fallback mode (seconds)
Configuration Options:
FILE_MONITORING_ENABLED (default: True) - Enable or disable automatic monitoringFILE_MONITORING_COALESCE_DELAY_MS (default: 200) - Time window in milliseconds to batch multiple changes into a single updateFILE_MONITORING_MAX_RELOADS_PER_SECOND (default: 5) - Maximum number of automatic updates per second to prevent UI thrashingFILE_MONITORING_FALLBACK_POLL_INTERVAL_S (default: 5) - Polling interval in seconds when native monitoring is unavailableYou can enable or disable monitoring while XeFM is running without restarting the application. Use the monitoring toggle command (check your key bindings) to switch monitoring on or off instantly.
When you disable monitoring at runtime:
XeFM uses different monitoring strategies depending on your storage type:
For local filesystems, XeFM uses efficient operating system APIs:
Native mode provides instant change detection with minimal resource usage (typically less than 5MB memory and 1% CPU per watched directory).
When native monitoring isn’t available on a local path, XeFM automatically switches to polling mode. This happens with:
In fallback mode, XeFM checks for changes every 5 seconds (configurable). While less responsive than native mode, it ensures monitoring works everywhere on local storage.
Automatic monitoring only works on paths that live in the local filesystem. For remote or virtual backends it is disabled — not even polling can watch them, because there is no local path to scan. This applies to:
For these locations the file list does not refresh automatically; refresh manually (re-enter the directory) to see changes. XeFM skips monitoring for them silently instead of reporting errors.
When XeFM operates in fallback mode due to storage limitations or errors, a status indicator appears in the interface. This lets you know that:
XeFM monitors only the immediate files and directories in the current view. Changes in subdirectories don’t trigger updates to the parent directory list—you’ll see those changes when you navigate into the subdirectory.
Both panes are monitored independently:
During automatic updates, XeFM preserves your context:
If the selected file still exists:
If the selected file was deleted:
Check if monitoring is enabled:
FILE_MONITORING_ENABLED is True in your configurationCheck for fallback mode indicator:
Browsing S3, SSH, or an archive?
Check the log file:
Network drives and remote filesystems often don’t support native change notifications. XeFM automatically detects this and switches to fallback polling mode. You should see the fallback mode indicator, and changes will appear within a few seconds.
If monitoring doesn’t work at all on a network drive:
FILE_MONITORING_FALLBACK_POLL_INTERVAL_S if the network is slowIf you’re working in a directory with very frequent changes (e.g., a build output directory), you might experience:
Solutions:
FILE_MONITORING_MAX_RELOADS_PER_SECOND to limit update frequencyFILE_MONITORING_COALESCE_DELAY_MS to batch more changes togetherXeFM includes automatic error recovery:
Check the log file for error messages. Common issues:
To recover:
cat /proc/sys/fs/inotify/max_user_watches)Linux systems limit the number of directories that can be monitored simultaneously. If you see “too many open files” errors:
# Check current limit
cat /proc/sys/fs/inotify/max_user_watches
# Temporarily increase limit (until reboot)
sudo sysctl fs.inotify.max_user_watches=524288
# Permanently increase limit
echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
Automatic file monitoring is designed to be lightweight:
For remote filesystems in fallback mode:
FILE_MONITORING_FALLBACK_POLL_INTERVAL_S to balance responsiveness vs. network usageYou might want to disable automatic monitoring if:
Disabling monitoring doesn’t affect XeFM’s core functionality—file lists still update after your actions like navigating, copying, or deleting files.
For developers and advanced users interested in implementation details, see:
doc/dev/FILE_MONITORING_IMPLEMENTATION.md - Architecture and implementationxefm/file_monitor_manager.py - Main monitoring coordinatorxefm/file_monitor_observer.py - Per-directory monitoringIf you encounter issues with automatic file monitoring: