: nply/wmenu

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 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
wmenu
=====

WARNING: AI-GENERATED CODEBASE
------------------------------
This codebase is AI-generated and requires a human touch: review, testing,
and maintenance. It is stable enough for everyday use, but has not received
an independent human audit.

About
-----
wmenu is a small Win32 picker for newline-separated input. Pipe text into
it, search the lines, and print the selected line to standard output. Input
can keep arriving while the window is open; the list and search cover all
loaded lines without drawing every row at once.

This is a hard fork inspired by LinArcX's original wmenu. This implementation
was written separately; the project name and idea come from LinArcX, not the
code in this fork. See Credits below.

Build
-----
On Windows, install Visual Studio Build Tools with the C compiler and GNU
make. Open a Developer Command Prompt in this directory, then run:

    make
    make test

For the larger synthetic-input test, run `make stress`. The build is defined
in Makefile; no Visual Studio project or batch launcher is needed. See
HACKING for development notes.

Use
---
    dir /b | .\wmenu.exe
    where.exe *.exe | .\wmenu.exe -p run:
    dir /b | .\wmenu.exe -c -w 800 -l 12

Options
-------
    -p text             prompt text
    -e utf8|ansi|oem    input/output encoding (default: utf8)
    -x px -y px -w px   position and width
    -c                  center the window
    -l lines            visible rows; -l-1 fills the screen (default: 5)
    -m                  multi-select (Ctrl+Enter adds; Enter finishes)
    -i                  ASCII case-insensitive matching
    -V                  vi mode; Ctrl+Alt+V toggles it
    -d                  native Windows edit shortcuts
    -b                  close when focus is lost
    -fn name -fs pt -fw weight
                        font face, size, and weight
    -v                  version
    -h                  help

Keys
----
    Enter               print selection and exit
    Esc                 exit (vi insert mode: return to normal mode)
    Up/Down             move selection
    Ctrl+N/P            next/previous row
    Ctrl+D/U            page down/up
    Ctrl+O/I            back/forward through visited searches and rows
    Ctrl+A/E            start/end of input
    Ctrl+K              delete to end of input
    Ctrl+W              cut selection
    Ctrl+Backspace      delete previous word
    Ctrl+Alt+V          toggle vi mode

Clearing the query returns to the first row. Location history keeps the
latest 128 searches and row positions.

Credits
-------
LinArcX created the original wmenu and inspired this hard fork:
    https://github.com/LinArcX/wmenu

The picker follows the dmenu interface from suckless:
    https://tools.suckless.org/dmenu/

arg.h is the suckless argument-parsing header by 20h. Its original header
is left intact; the MIT/X Consortium terms are included in LICENSE.

License
-------
This fork's code is BSD 3-Clause licensed; see LICENSE. The third-party arg.h
is MIT/X Consortium licensed; its notice is included in LICENSE. Older
upstream releases and histories have their own copyright and licensing terms.