Skip to content

Add cross-platform get-cwd helper for file widget #211

@RobLoach

Description

@RobLoach

nuklear_console_file.h:868 notes "TODO: file: Make get current working directory function." Today users must hand-construct a starting path or call getcwd/GetCurrentDirectoryA themselves. The widget already abstracts file enumeration across tinydir/SDL3/raylib backends but stops short of CWD.

Suggested Implementation

Add nk_console_file_get_cwd(char* out, int out_size) returning nk_bool, dispatching on _WIN32 (GetCurrentDirectoryA) vs POSIX (getcwd). Use it as the default starting directory when none is supplied to nk_console_file_set_directory.

QA

  • Demo opens at the executable's CWD without the app passing a path.
  • New test asserts the returned path resolves to a non-empty string on both Linux and Windows CI legs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions