Commits

trunk
Switch branches/tags
All users
Until Apr 8, 2026
May 2026
Su Mo Tu We Th Fr Sa
26 27 28 29 30 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31 1 2 3 4 5 6

Commits on April 5, 2026

  1. set current_command in -c mode for job descriptions
    shell%current_command was only set in the interactive REPL loop.
    In -c mode it stayed empty, causing background jobs to show
    '<background job>' instead of the actual command. The POSIX job
    control test checks for 'sleep' in jobs output.
    
    Revert sleep duration back to 0.5 — the failure was not a race.
    espadonne committed

Commits on April 4, 2026

  1. increase sleep duration in POSIX job control test to avoid race
    sleep 0.5 could finish before jobs runs on fast CI runners,
    causing the test to see Done instead of Running.
    espadonne committed
  2. force fresh session when test specifies custom env variables
    Tests with env field (like MYVAR=testvalue for variable completion)
    need a fresh PTY session to inherit the custom environment. On Linux
    with tests_per_session=10, reused sessions don't have the custom env.
    espadonne committed
  3. add execute_and_capture_tabs for space-preserving filename completion
    New execute_and_capture_tabs converts newlines to tabs (not spaces),
    preserving spaces in filenames. scan_directory uses it with tab-
    delimited parse_ls_output for correct completion of paths like
    '/tmp/test dir/' and '/tmp/quoted file.txt'.
    
    parse_ls_output now accepts optional use_tab_delim parameter.
    
    Fixes the final 2 completion tests: paths with spaces (9) and
    quoted filenames (29). completion: 36/36 PERFECT.
    espadonne committed
  4. quote-aware completion: wrap completions in quotes, fix variable test
    Tab completion now preserves quote context: ls '/tmp/test d<Tab>
    correctly wraps the completed path in matching quotes. Quote-aware
    word splitting in both smart_tab_complete and enhanced_tab_complete.
    
    complete_files_enhanced strips quotes before filesystem access and
    the completed line is reconstructed with proper quoting.
    
    Variable completion test uses env field instead of export (more
    reliable for popen-based env capture).
    
    Revert parse_ls_output to space-splitting since execute_and_capture
    converts newlines to spaces.
    
    Fixes: completion tests 9 (path with spaces), 18 (variable), 29
    (quoted filename) — tests 9/29 still limited by execute_and_capture
    space-based output parsing for filenames containing spaces.
    espadonne committed
  5. fix Linux build: preprocessor directives must start at column 1
    #ifdef __APPLE__ had leading spaces in builtins.f90 kill signal
    number blocks. gfortran requires preprocessor directives at column 1.
    Also reduce ls_output buffer from 16KB to 8KB (with grep filter).
    espadonne committed
  6. quote-aware word splitting and newline-delimited completion parsing
    - Tab completion now respects quotes when finding the last word:
      ls '/tmp/test d<Tab> treats the quoted path as one word.
    - parse_ls_output uses newline delimiters instead of spaces to
      preserve filenames containing spaces.
    - ls command no longer uses tr to convert newlines — keeps raw output.
    - Variable completion test uses export for env visibility.
    - Completion buffer increased to 16KB for large directories.
    
    Quoted path completion (tests 9, 29) still needs quote reconstruction
    in the completed line output. Variable completion for unexported vars
    needs shell state access in readline.
    espadonne committed
  7. always wait_for_prompt after Ctrl+C in test runner
    Ctrl+C always returns to prompt regardless of the next step type.
    Previously only waited when next step needed input (send/send_key),
    but Ctrl+C during command substitution needs prompt sync even when
    next step is 'wait'. Fixes signals_jobs test 38.
    
    signals_jobs: 39/39 (100%) — all signal and job control tests pass.
    espadonne committed
  8. fix empty PS1 test: combine PS1 set and echo in one command
    The test set PS1='' then tried to send another command, but the empty
    prompt broke the test runner's prompt detection between steps.
    Combining into PS1=''; echo emptyps1 avoids the sync issue.
    espadonne committed
  9. fix completion buffer overflow on large directories, add grep filter
    The 2KB ls_output buffer overflowed on directories with many files
    (like /tmp with 11KB of entries), causing completion to miss files
    late in the sorted listing. Increased to 16KB and added grep -i prefix
    filter when a pattern exists to limit output size.
    
    Fixes filename and case-preserving completion on macOS /tmp.
    espadonne committed
  10. refine send_line sync: wait_for_prompt for all non-blocking commands
    Only skip wait_for_prompt for true foreground blocking commands
    (non-background, non-job-control, followed by explicit 'wait' step).
    All other send_line steps get prompt sync on macOS — fixes disown,
    wait, jobs, and subshell background job tests (35, 37, 39).
    
    Add 'jobs' to job control command list for marker sync detection.
    espadonne committed
  11. fix kill builtin signal numbers on macOS, update job state on SIGCONT
    kill: use platform-specific signal numbers for SIGCHLD, SIGCONT,
    SIGTSTP instead of hardcoded Linux values. When kill -CONT is sent
    to a job spec (%N), update the job state to JOB_RUNNING.
    
    test runner: skip marker sync for job control commands (bg, fg, kill,
    disown, wait) whose output interacts with background processes.
    Fixes kill -CONT %1 test (33) and bg tests (24, 25).
    espadonne committed
  12. skip marker sync for job control commands (bg, fg, kill, wait, disown)
    Job control commands interact with background processes whose output
    can swallow the sync marker echo, causing 10s timeout. Use
    wait_for_prompt instead. Fixes bg/bg %1 tests (24, 25).
    
    Also increase last-step delay to 300ms on macOS for flang-new I/O
    flush time.
    espadonne committed
  13. respect HISTFILE env var at startup, disable in tests
    Shell: check HISTFILE env var before loading history file. Previously
    always loaded ~/.fortsh_history regardless of HISTFILE setting.
    
    Tests: set HISTFILE=/dev/null in PTY environment to prevent history
    file from polluting per-test history. Fixes history test 5 (up arrow
    at boundary recalled commands from previous sessions).
    
    Also restore clear_buffer in non-marker sync path to fix history
    tests 8, 11, 12.
    espadonne committed
  14. restore clear_buffer after wait_for_prompt in non-marker sync path
    Without clear_buffer, stale command output polluted the pexpect buffer
    for tests using Ctrl+R search and history navigation. Restoring it
    fixes history tests 8, 11, 12 without regressing signals_jobs (job
    status output comes from the last step which has no sync).
    espadonne committed
  15. add variable name completion for $VAR<Tab>
    Detect $ prefix in tab completion and match against environment
    variable names. Completes exported/env vars using env command output.
    Full shell variable completion requires readline access to shell state
    (future enhancement).
    espadonne committed
  16. use shell current_command for background job descriptions
    The AST executor tried to reconstruct command text from the AST but
    only handled CMD_SIMPLE nodes. Pipeline and subshell background jobs
    showed '<background job>' instead of the actual command. Now uses
    shell%current_command which has the full command text.
    espadonne committed
  17. implement disown builtin
    Removes a job from the shell's job table. Supports job specs (%n)
    or defaults to the current job. The process continues running but
    is no longer tracked by the shell.
    espadonne committed
  18. pass current_command to execute_pipeline for job descriptions
    The AST executor was passing empty string as original_input to the
    legacy executor's execute_pipeline. Background and stopped jobs had
    blank command text in 'jobs' output. Now passes shell%current_command
    so job descriptions show the actual command (e.g. 'sleep 10').
    espadonne committed
  19. set JOB_STOPPED in executor after add_job for suspended processes
    add_job defaults state to JOB_RUNNING. The executor's waitpid consumes
    the stopped status, so update_job_status can't detect it later. Now
    both the legacy and AST executors explicitly set JOB_STOPPED in the
    job table after add_job for WIFSTOPPED processes.
    
    Fixes 'jobs' showing Running instead of Stopped after Ctrl+Z.
    espadonne committed
  20. add WUNTRACED to ast_executor waitpid, add WSTOPSIG, refine test sync
    ast_executor: waitpid now passes WUNTRACED so stopped processes
    (Ctrl+Z/SIGTSTP) are detected. Added WIFSTOPPED handling in pipeline
    wait loop. Added WSTOPSIG helper to system_interface.
    
    test runner: skip marker sync for background commands (ending with &)
    to prevent 10s timeout from letting jobs complete before 'jobs' runs.
    Remove clear_buffer after signal key prompt wait to preserve job status
    output. Detect background commands to use appropriate sync strategy.
    espadonne committed
  21. fix signal numbers on macOS, wait for prompt after Ctrl+C/Z in tests
    Shell: use named signal constants (SIGCHLD, SIGINT, SIGTSTP) instead
    of hardcoded Linux numbers in setup_signal_handlers. Add #ifdef
    __APPLE__ for signal constants 17-22 in signal_handling.f90.
    
    Test runner: after Ctrl+C/Z signal keys, wait for prompt before sending
    more input. The shell needs time to process the signal, reap children,
    and enter readline. Only wait when more input steps follow — if the
    signal is the last step, let expect_output find the signal message.
    
    Fixes signals_jobs tests 1, 3, 5, 9, 10 (Ctrl+C interrupt, Ctrl+Z
    suspend).
    espadonne committed
  22. fix hardcoded Linux signal numbers on macOS, improve test sync
    signals.f90: use named SIGCHLD/SIGINT/SIGTSTP/SIGTTIN/SIGTTOU constants
    from system_interface instead of hardcoded Linux numbers in
    setup_signal_handlers(). Also fix get_signal_number() for SIGTSTP/SIGCONT.
    
    signal_handling.f90: add #ifdef __APPLE__ for signal constants 17-22
    which differ between Linux and macOS (SIGCHLD=20, SIGTSTP=18, etc).
    
    readline.f90: Ctrl+R Enter now executes the found command (bash behavior).
    Ctrl+L works on empty prompt.
    
    test runner: clear buffer after wait_for_prompt sync to prevent stale
    output from polluting subsequent expect calls. Prefix sync markers with
    leading space to exclude from command history.
    espadonne committed
  23. fix Ctrl+R Enter to execute found command, clear stale buffer after sync
    Shell: Enter during Ctrl+R search now executes the found command
    immediately (bash behavior). Previously it only accepted the search
    result into the buffer without executing.
    
    Test runner: clear pexpect buffer after wait_for_prompt in non-marker
    sync path. Stale command output (e.g. 'echo other') was polluting the
    expect buffer for subsequent steps. Also prefix sync marker echos with
    space to exclude from command history.
    espadonne committed

Commits on April 3, 2026

  1. add set -o fuzzy-complete for opt-in fuzzy tab completion
    Tab completion now uses prefix-only matching by default (like bash/zsh).
    Fuzzy subsequence matching (where 'fort' matches 'install_intel_fortran')
    is available via: set -o fuzzy-complete
    
    Short patterns (≤3 chars) always require prefix match regardless of
    the setting, to prevent noise like 'ls' matching 'false'.
    espadonne committed
  2. allow Ctrl+L to clear screen on empty prompt
    Ctrl+L was gated on buffer length > 0 as a workaround for a phantom
    form-feed from Fortran I/O flush. The root cause was fixed by explicit
    flush(output_unit) after command execution, so the guard is no longer
    needed. Now Ctrl+L works like bash/fish on empty prompts.
    espadonne committed
  3. add Ctrl+P/Ctrl+N emacs keybindings for history navigation
    Ctrl+P (previous-history) and Ctrl+N (next-history) are standard emacs
    readline bindings that were missing. Only arrow keys worked for history
    navigation. Fixes history tests 5-8 on all platforms.
    espadonne committed
  4. fix USE_C_STRINGS vs USE_MEMORY_POOL preprocessor precedence in readline
    On macOS ARM64 both flags are defined. Accessor functions for search
    strings, vi command buffer, menu prefix, and original buffer checked
    USE_MEMORY_POOL first, dereferencing uninitialized pool refs → SIGSEGV
    in Ctrl+R search, vi-mode commands, tab completion, and undo.
    
    Fix 29 accessor guards (not init/cleanup) to avoid flang-new codegen
    butterfly effect. Also sync editing_mode from global on each readline
    call so set -o vi / set -o emacs takes effect immediately.
    espadonne committed
  5. harden macOS interactive test runner for flang-new I/O timing
    Three changes to fix 135 of 158 macOS PTY test failures:
    
    1. tests_per_session=1 on macOS: fresh PTY per test eliminates cursor
       tracking corruption from readline state leaking across sessions.
    
    2. Marker-based sync for send_line→send_line steps: echo a unique
       marker after setup commands, wait for it. Replaces unreliable 50ms
       fixed delay and avoids greedy '> ' prompt matching.
    
    3. wait_for_prompt for send_line→interactive steps: ensures quick
       commands (set -o vi) complete before key sequences arrive. Skipped
       for long-running commands (sleep) where next step is 'wait'.
    
    Linux unchanged (50ms delay, tests_per_session=10).
    espadonne committed