fgof-lineedit Public
Go to file
T
Code
Use Git or checkout with SVN using the web URL.
No matching headings.
fgof-lineedit
Fortran-native line editing helpers for interactive CLI tools.
fgof-lineedit is intended to be a small, standalone library that gives Fortran shells, REPLs, and interactive CLIs a friendlier editing surface than raw terminal reads.
It is part of the FortranGoingOnForty lib-modules catalog, but it is intended to stand on its own as a normal fpm package.
Current v1 target:
- editable line buffer and cursor model
- prompt handling and rendered line state
- history navigation and history storage hooks
- completion and key-handling integration points
- clean boundaries with future
fgof-termiosandfgof-keys
Future scope:
- richer readline-style editing commands
- completion engines and menu UIs
- prompt widgets and multi-line editing
Status
Initial scaffold is in place.
Implemented today:
- public
fgof_lineeditandfgof_lineedit_typesmodules - line editor and prompt-state types
- prompt constructor, editable buffer core, and cursor movement helpers
- smoke-test coverage and CI wiring
Still to implement:
- history and completion hooks
- terminal integration and redraw behavior
Why Use It
- line editing is repeatedly hand-built in shells, REPLs, and text tools
- the Fortran ecosystem still lacks an obvious small default package here
- it is meant to compose cleanly with
fgof-pty, futurefgof-termios, and futurefgof-keys
Public API Shape
Primary modules:
fgof_lineeditfgof_lineedit_types
Public types:
lineedit_stateprompt_spec
Current public procedures:
buffer_lengthset_bufferinsert_textdelete_leftdelete_rightdefault_promptinit_lineeditmove_cursor_leftmove_cursor_rightmove_cursor_homemove_cursor_endreset_lineedit
Quick Start
program demo_lineedit
use fgof_lineedit, only : default_prompt, init_lineedit, insert_text, lineedit_state, move_cursor_left
implicit none
type(lineedit_state) :: editor
call init_lineedit(editor, default_prompt("> "))
call insert_text(editor, "help")
call move_cursor_left(editor)
print "(A)", editor%buffer
end program demo_lineedit
Build And Test
fpm test
That is the baseline verification command locally and in CI.
Supported Platforms
- macOS
- Linux
Boundaries
- intended to stay independently versioned and releasable
- focused on editing state and library ergonomics, not full shell implementation
- terminal-mode control should stay in a future companion package
License
MIT