cui-py 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. {cui_py-0.2.0 → cui_py-0.3.0}/.github/workflows/build-publish.yml +3 -3
  2. {cui_py-0.2.0 → cui_py-0.3.0}/.github/workflows/ci.yml +23 -0
  3. {cui_py-0.2.0 → cui_py-0.3.0}/CHANGELOG.md +32 -0
  4. cui_py-0.3.0/CMakeLists.txt +58 -0
  5. {cui_py-0.2.0 → cui_py-0.3.0}/Makefile +9 -3
  6. {cui_py-0.2.0 → cui_py-0.3.0}/PKG-INFO +6 -6
  7. {cui_py-0.2.0 → cui_py-0.3.0}/README.md +5 -4
  8. {cui_py-0.2.0 → cui_py-0.3.0}/TODO.md +23 -0
  9. {cui_py-0.2.0 → cui_py-0.3.0}/csrc/cuipy_pty.c +1 -1
  10. {cui_py-0.2.0 → cui_py-0.3.0}/csrc/cuipy_pty.h +1 -1
  11. cui_py-0.3.0/csrc/term/CMakeLists.txt +41 -0
  12. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/boxdraw.h +2 -2
  13. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/cuix.h +5 -5
  14. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/pty.h +2 -2
  15. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/session.c +1 -1
  16. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/session.h +2 -2
  17. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/term_view.h +2 -2
  18. {cui_py-0.2.0 → cui_py-0.3.0}/docs/dev/coverage.md +43 -38
  19. cui_py-0.3.0/docs/dev/cui-api-json-gaps.md +125 -0
  20. cui_py-0.3.0/docs/dev/terminal.md +76 -0
  21. cui_py-0.3.0/examples/ide.py +414 -0
  22. cui_py-0.3.0/examples/notepad.py +288 -0
  23. {cui_py-0.2.0 → cui_py-0.3.0}/examples/term.py +1 -1
  24. cui_py-0.3.0/examples/tictactoe.py +281 -0
  25. {cui_py-0.2.0 → cui_py-0.3.0}/pyproject.toml +3 -4
  26. {cui_py-0.2.0 → cui_py-0.3.0}/src/cui/__init__.py +1 -1
  27. {cui_py-0.2.0 → cui_py-0.3.0}/src/cui/_core.pyi +286 -1
  28. {cui_py-0.2.0 → cui_py-0.3.0}/src/cui/_core.pyx +57 -1
  29. {cui_py-0.2.0 → cui_py-0.3.0}/src/cui/_cui.pxd +1 -0
  30. {cui_py-0.2.0 → cui_py-0.3.0}/src/cui/_gen.pxi +1357 -6
  31. cui_py-0.3.0/tests/c/CMakeLists.txt +19 -0
  32. cui_py-0.3.0/tests/c/check.h +51 -0
  33. cui_py-0.3.0/tests/c/test_pty.c +144 -0
  34. cui_py-0.3.0/tests/c/test_session.c +321 -0
  35. cui_py-0.3.0/tests/c/test_view.c +314 -0
  36. {cui_py-0.2.0 → cui_py-0.3.0}/tests/smoke_all.py +14 -1
  37. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_components.py +10 -0
  38. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_cui.py +9 -0
  39. cui_py-0.3.0/tests/test_examples.py +280 -0
  40. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_frame.py +18 -0
  41. cui_py-0.3.0/tests/test_pointer_kinds.py +377 -0
  42. cui_py-0.3.0/tools/compat-render.sh +51 -0
  43. cui_py-0.3.0/tools/compat.sh +160 -0
  44. {cui_py-0.2.0 → cui_py-0.3.0}/tools/core_stub_tail.pyi.in +4 -0
  45. {cui_py-0.2.0 → cui_py-0.3.0}/tools/gen_bindings.py +471 -29
  46. {cui_py-0.2.0 → cui_py-0.3.0}/uv.lock +1 -1
  47. cui_py-0.2.0/CMakeLists.txt +0 -87
  48. cui_py-0.2.0/tests/test_examples.py +0 -103
  49. cui_py-0.2.0/thirdparty/cui-repl/LICENSE +0 -21
  50. cui_py-0.2.0/thirdparty/cui-repl/VENDORED +0 -4
  51. {cui_py-0.2.0 → cui_py-0.3.0}/.gitignore +0 -0
  52. {cui_py-0.2.0 → cui_py-0.3.0}/LICENSE +0 -0
  53. {cui_py-0.2.0 → cui_py-0.3.0}/csrc/cuipy_pty_stub.c +0 -0
  54. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/boxdraw.c +0 -0
  55. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/cuix.c +0 -0
  56. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/pty.c +0 -0
  57. {cui_py-0.2.0/thirdparty/cui-repl/src → cui_py-0.3.0/csrc/term}/term_view.c +0 -0
  58. {cui_py-0.2.0 → cui_py-0.3.0}/docs/dev/issues/cui-state-reset.md +0 -0
  59. {cui_py-0.2.0 → cui_py-0.3.0}/docs/dev/known-issues.md +0 -0
  60. {cui_py-0.2.0 → cui_py-0.3.0}/examples/dashboard.py +0 -0
  61. {cui_py-0.2.0 → cui_py-0.3.0}/examples/hello.py +0 -0
  62. {cui_py-0.2.0 → cui_py-0.3.0}/examples/showcase.py +0 -0
  63. {cui_py-0.2.0 → cui_py-0.3.0}/examples/todo.py +0 -0
  64. {cui_py-0.2.0 → cui_py-0.3.0}/src/cui/py.typed +0 -0
  65. {cui_py-0.2.0 → cui_py-0.3.0}/tests/__init__.py +0 -0
  66. {cui_py-0.2.0 → cui_py-0.3.0}/tests/conftest.py +0 -0
  67. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_app.py +0 -0
  68. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_buffers.py +0 -0
  69. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_canvas.py +0 -0
  70. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_input.py +0 -0
  71. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_nested.py +0 -0
  72. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_options.py +0 -0
  73. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_pty.py +0 -0
  74. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_scopes.py +0 -0
  75. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_smoke.py +0 -0
  76. {cui_py-0.2.0 → cui_py-0.3.0}/tests/test_state.py +0 -0
  77. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/CMakeLists.txt +0 -0
  78. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/LICENSE +0 -0
  79. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/THIRD_PARTY.md +0 -0
  80. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/VENDORED +0 -0
  81. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/assets/fonts/LICENSE-Geist.txt +0 -0
  82. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/assets/fonts/LICENSE-Inter.txt +0 -0
  83. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/assets/fonts/LICENSE-Lucide.txt +0 -0
  84. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/cmake/CuiApp.cmake +0 -0
  85. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/cmake/mingw-w64.cmake +0 -0
  86. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/include/cui/cui.h +0 -0
  87. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/include/cui/cui_app.h +0 -0
  88. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/include/cui/cui_icons.h +0 -0
  89. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/include/cui/cui_ios_main.h +0 -0
  90. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/include/cui/cui_render.h +0 -0
  91. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_actions.c +0 -0
  92. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_ai.c +0 -0
  93. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_bidi.c +0 -0
  94. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_bidi.h +0 -0
  95. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_bidi_data.h +0 -0
  96. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_canvas.c +0 -0
  97. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_charts.c +0 -0
  98. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_chrome.c +0 -0
  99. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_code.c +0 -0
  100. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_controls.c +0 -0
  101. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_core.c +0 -0
  102. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_creative.c +0 -0
  103. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_curves.c +0 -0
  104. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_data.c +0 -0
  105. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_devpanels.c +0 -0
  106. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_devtools.c +0 -0
  107. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_devviews.c +0 -0
  108. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_dials.c +0 -0
  109. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_diff.c +0 -0
  110. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_disclosure.c +0 -0
  111. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_dock.c +0 -0
  112. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_draw.c +0 -0
  113. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_editor.c +0 -0
  114. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_emoji.c +0 -0
  115. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_emoji_data.h +0 -0
  116. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_extras.c +0 -0
  117. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_files.c +0 -0
  118. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_flame.c +0 -0
  119. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_font_data.c +0 -0
  120. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_graph.c +0 -0
  121. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_grid.c +0 -0
  122. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_hex.c +0 -0
  123. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_image.c +0 -0
  124. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_inflate.c +0 -0
  125. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_instrument.c +0 -0
  126. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_internal.h +0 -0
  127. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_joining.h +0 -0
  128. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_layout.c +0 -0
  129. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_loading.c +0 -0
  130. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_markdown.c +0 -0
  131. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_media.c +0 -0
  132. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_month.c +0 -0
  133. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_motion.c +0 -0
  134. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_nodes.c +0 -0
  135. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_overlay.c +0 -0
  136. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_photo.c +0 -0
  137. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_pickers.c +0 -0
  138. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_planning.c +0 -0
  139. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_regex.c +0 -0
  140. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_shape.c +0 -0
  141. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_shape.h +0 -0
  142. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_social.c +0 -0
  143. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_strings.c +0 -0
  144. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_terminal.c +0 -0
  145. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_text.c +0 -0
  146. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_textedit.c +0 -0
  147. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_theme.c +0 -0
  148. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_timeline.c +0 -0
  149. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_tools.c +0 -0
  150. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_tour.c +0 -0
  151. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_treetable.c +0 -0
  152. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_viz.c +0 -0
  153. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_voice.c +0 -0
  154. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/cui_widgets.c +0 -0
  155. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_app.c +0 -0
  156. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_app_android.c +0 -0
  157. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_app_cocoa.m +0 -0
  158. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_app_glfw.c +0 -0
  159. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_app_ios.m +0 -0
  160. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_app_sdl2.c +0 -0
  161. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_app_win32.c +0 -0
  162. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_app_x11.c +0 -0
  163. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_dialogs.c +0 -0
  164. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/platform/cui_platform.h +0 -0
  165. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/render/cui_render_d3d12.c +0 -0
  166. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/render/cui_render_gl.c +0 -0
  167. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/render/cui_render_metal.m +0 -0
  168. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/render/cui_render_sw.c +0 -0
  169. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/render/cui_render_vulkan.c +0 -0
  170. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/render/cui_render_vulkan.frag +0 -0
  171. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/render/cui_render_vulkan.vert +0 -0
  172. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/src/render/generated/cui_render_vulkan_spirv.h +0 -0
  173. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/third_party/LICENSE-Unicode.txt +0 -0
  174. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/third_party/stb_image.h +0 -0
  175. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/third_party/stb_image_write.h +0 -0
  176. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/third_party/stb_rect_pack.h +0 -0
  177. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/cui/third_party/stb_truetype.h +0 -0
  178. {cui_py-0.2.0 → cui_py-0.3.0}/thirdparty/patches/cui-state-reset.patch +0 -0
  179. {cui_py-0.2.0 → cui_py-0.3.0}/tools/core_stub_head.pyi.in +0 -0
  180. {cui_py-0.2.0 → cui_py-0.3.0}/tools/install-zig.sh +0 -0
@@ -3,7 +3,7 @@ name: Build and Publish
3
3
  on:
4
4
  push:
5
5
  tags:
6
- - "v*"
6
+ - "[0-9]*" # bare versions, as `make release` tags them: 0.2.0
7
7
  pull_request:
8
8
  branches: [main, master]
9
9
  workflow_dispatch:
@@ -166,7 +166,7 @@ jobs:
166
166
  name: Publish to TestPyPI
167
167
  needs: collect-artifacts
168
168
  runs-on: ubuntu-latest
169
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
169
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
170
170
  environment:
171
171
  name: testpypi
172
172
  url: https://test.pypi.org/p/cui-py
@@ -189,7 +189,7 @@ jobs:
189
189
  name: Publish to PyPI
190
190
  needs: [collect-artifacts, publish-testpypi]
191
191
  runs-on: ubuntu-latest
192
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
192
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
193
193
  environment:
194
194
  name: pypi
195
195
  url: https://pypi.org/p/cui-py
@@ -88,6 +88,29 @@ jobs:
88
88
  path: dist/*.whl
89
89
  retention-days: 7
90
90
 
91
+ test-c:
92
+ # C tests of the terminal code in csrc/term; Windows has no pty.
93
+ name: C tests (${{ matrix.os }})
94
+ runs-on: ${{ matrix.os }}
95
+ strategy:
96
+ fail-fast: false
97
+ matrix:
98
+ os: [ubuntu-latest, macos-latest]
99
+ steps:
100
+ - uses: actions/checkout@v7
101
+
102
+ - name: Install X11 headers (CUI's Linux backend)
103
+ if: runner.os == 'Linux'
104
+ run: sudo apt-get update && sudo apt-get install -y libx11-dev
105
+
106
+ - name: Install Zig 0.17.1
107
+ run: |
108
+ sh tools/install-zig.sh "$RUNNER_TEMP/zig"
109
+ echo "$RUNNER_TEMP/zig" >> "$GITHUB_PATH"
110
+
111
+ - name: Build and run
112
+ run: make test-c
113
+
91
114
  collect-artifacts:
92
115
  name: Collect all artifacts
93
116
  needs: build
@@ -6,6 +6,38 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ### Fixed
10
+
11
+ - `examples/ide.py` on Linux: after File > Open, Ctrl+R, Ctrl+S and the other shortcuts reached the shell. The terminal takes focus when first shown and kept it, and on Linux a focused terminal takes Ctrl keys. A newly opened editor now takes focus. The 0.3.0 Linux wheel build failed on this test, so 0.3.0 was not published.
12
+ - A `Context` freed by the cycle collector raised `TypeError` inside its dealloc, reported as an ignored exception. The collector set its attributes to `None` before the dealloc ended the frame through them. They are now exempt from that clearing (`cython.no_gc_clear`).
13
+
14
+ ## [0.3.0]
15
+
16
+ ### Added
17
+
18
+ - Every function in CUI 1.5 is now wrapped or excluded on purpose; 34 were not. The generator wraps 26, among them `diff_compute`, `regex_search`, `fs_list`, `timeline_editor`, `query_builder` and `feature_flags`. `Context.theme_get` / `theme_update` and `set_strings` / `get_strings` are hand-written: CUI edits the theme in place and keeps the strings table across frames, which the frame-scoped storage of generated code cannot hold. The 5 `cui_gpu_*` functions are excluded, as the OpenGL ones are: `Context` owns its renderer.
19
+
20
+ Most of them needed a fact the header states only in prose, such as which parameter sizes an array or that a pointer is only written. New tables in `tools/gen_bindings.py` record these (`OUT_ARRAYS`, `BORROWED`, `MUT_FIELDS`, `FIELD_ARRAYS`, and others), so the tables now hold more of the binding's assumptions; `docs/dev/cui-api-json-gaps.md` discusses moving them upstream.
21
+
22
+ - `examples/notepad.py`: a text editor with a File / Edit / View / Help menu bar, shortcuts for the same actions, native open and save dialogs, and a status bar.
23
+
24
+ - `examples/tictactoe.py`: a game against a minimax player or a second person. One action table builds its menus and checks its shortcuts, so a menu item and its key cannot disagree. `notepad.py` writes them as two lists, which shows each API call directly.
25
+
26
+ - `examples/ide.py`: a file tree, tabbed code editors, and a shell on a `cui.Pty` in a resizable panel; Run saves the current Python file and runs it there. The panel cannot be hidden. A Pty with no view stalls its child, and a 1 pt view that drains it keeps keyboard focus and runs what is typed unseen.
27
+
28
+ ### Changed
29
+
30
+ - The terminal code behind `cui.Pty` is part of cui-py, in `csrc/term/`, and no longer a copy of the cui-repl project. Its C tests moved to `tests/c/` (`make test-c`, needs Zig 0.17) and its manual compatibility script to `tools/compat.sh`, which now opens `examples/term.py`. Wheels no longer ship `licenses/cui-repl.txt`; cui-py's license covers the code. `docs/dev/terminal.md` has the design notes and cui-repl's history.
31
+ - Children of a `cui.Pty` see `TERM_PROGRAM=cui-py`, was `cui-repl`.
32
+ - `make test-c` runs in CI on Linux and macOS.
33
+
34
+ ### Fixed
35
+
36
+ - A `CUI_PY_PTY` build of a tagged commit aborted in libghostty-vt's `zig build`. Given no version, ghostty reads `git tag --points-at HEAD`; from under `build/` that finds cui-py's tag, such as `0.2.0`, and panics because it is not `vX.Y.Z`. The build now passes `-Dversion-string=1.0.0`.
37
+ - Pushing a release tag did not start the release workflow: it matched `v*`, but cui-py's tags are bare (`0.2.0`). The workflow and `make release` now use bare tags, matching the existing ones.
38
+ - `Context.month_calendar` with `month=None` raised `ValueError: day 0 must be in range`. CUI fills in only the year and month of a missing month, leaving day 0, which `datetime.date` rejects. A date with day 0 now reads as the 1st; `None` would have dropped the month, and passed back it would reset the calendar to today.
39
+ - `cui.voice_resample` wrote `columns` floats into a single stack `float`. The generator took `float *out` for one inout value, because `columns` is not a name it recognizes as a count. `out` is now a sequence whose length sets `columns`, and the call returns `(written, levels)`: `voice_resample(levels, [0.0] * 40)`. The `columns` argument is gone.
40
+
9
41
  ## [0.2.0]
10
42
 
11
43
  ### Added
@@ -0,0 +1,58 @@
1
+ cmake_minimum_required(VERSION 3.15...3.31)
2
+ project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION} LANGUAGES C)
3
+
4
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
5
+ # libcui.a is linked into a Python extension, a shared object.
6
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
7
+
8
+ set(CUI_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
9
+ set(CUI_BUILD_TESTS OFF CACHE BOOL "" FORCE)
10
+ set(CUI_BUILD_SHARED OFF CACHE BOOL "" FORCE)
11
+ add_subdirectory(thirdparty/cui EXCLUDE_FROM_ALL)
12
+
13
+ find_package(Python REQUIRED COMPONENTS Interpreter Development.Module ${SKBUILD_SABI_COMPONENT})
14
+
15
+ set(PYSRC "${CMAKE_CURRENT_SOURCE_DIR}/src/cui")
16
+ add_custom_command(
17
+ OUTPUT _core.c
18
+ COMMAND Python::Interpreter -m cython -I "${CMAKE_CURRENT_SOURCE_DIR}/src"
19
+ "${PYSRC}/_core.pyx" --output-file _core.c
20
+ DEPENDS "${PYSRC}/_core.pyx" "${PYSRC}/_gen.pxi" "${PYSRC}/_cui.pxd"
21
+ )
22
+
23
+ # Stable ABI per wheel.py-api; empty on builds that cannot use it (free-threaded).
24
+ if(SKBUILD_SABI_VERSION)
25
+ set(CUI_SABI USE_SABI ${SKBUILD_SABI_VERSION})
26
+ endif()
27
+ python_add_library(_core MODULE _core.c WITH_SOABI ${CUI_SABI})
28
+ target_link_libraries(_core PRIVATE cui)
29
+
30
+ # cui.Pty: a terminal on a pty, emulated by libghostty-vt; see csrc/term.
31
+ # cuipy_pty is a static library either way, so the component's flags and CUI's
32
+ # private headers stay out of _core.
33
+ option(CUI_PY_PTY "Build cui.Pty (POSIX only; needs Zig 0.17)" OFF)
34
+ if(CUI_PY_PTY)
35
+ if(WIN32)
36
+ message(FATAL_ERROR "CUI_PY_PTY needs a POSIX pty; Windows has none")
37
+ endif()
38
+ if(CMAKE_VERSION VERSION_LESS 3.19)
39
+ message(FATAL_ERROR "CUI_PY_PTY needs CMake 3.19 for libghostty-vt")
40
+ endif()
41
+ add_subdirectory(csrc/term)
42
+ add_library(cuipy_pty STATIC csrc/cuipy_pty.c)
43
+ target_link_libraries(cuipy_pty PRIVATE cuiterm)
44
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
45
+ # The archive bundles Zig's compiler_rt and ubsan_rt; keep them unexported.
46
+ target_link_options(_core PRIVATE -Wl,--exclude-libs,libghostty-vt.a)
47
+ endif()
48
+ install(FILES "${GHOSTTY_LICENSE}" DESTINATION cui/licenses
49
+ RENAME libghostty-vt.txt COMPONENT python)
50
+ else()
51
+ add_library(cuipy_pty STATIC csrc/cuipy_pty_stub.c)
52
+ endif()
53
+ target_include_directories(cuipy_pty PUBLIC csrc)
54
+ target_link_libraries(cuipy_pty PRIVATE cui)
55
+ target_link_libraries(_core PRIVATE cuipy_pty)
56
+
57
+ # Only the extension: CUI's own install rules would add libcui.a and its headers.
58
+ install(TARGETS _core DESTINATION cui COMPONENT python)
@@ -7,7 +7,7 @@
7
7
  .PHONY: all sync build build-pty rebuild test lint lint-check format format-check \
8
8
  typecheck qa clean distclean wheel sdist dist check publish-test \
9
9
  publish upgrade coverage coverage-html docs release help \
10
- gen test-window test-asan
10
+ gen test-window test-asan test-c
11
11
 
12
12
  # Default target
13
13
  all: build
@@ -34,6 +34,11 @@ rebuild: build
34
34
  test:
35
35
  @uv run pytest tests/ -v
36
36
 
37
+ # C tests for csrc/term, the terminal component. Needs Zig 0.17 on PATH.
38
+ test-c:
39
+ @cmake -S tests/c -B build/ctest -DCMAKE_BUILD_TYPE=RelWithDebInfo >/dev/null && \
40
+ cmake --build build/ctest -j && ctest --test-dir build/ctest --output-on-failure
41
+
37
42
  # Regenerate src/cui/_cui.pxd, _gen.pxi, _core.pyi and docs/dev/coverage.md
38
43
  # from thirdparty/cui/include. Needs libclang (fetched by uv) and clang.
39
44
  gen:
@@ -130,8 +135,8 @@ release:
130
135
  sed "s/^version = .*/version = \"$$version\"/" pyproject.toml > pyproject.toml.tmp && mv pyproject.toml.tmp pyproject.toml; \
131
136
  git add pyproject.toml; \
132
137
  git commit -m "Bump version to $$version"; \
133
- git tag -a "v$$version" -m "Release $$version"; \
134
- echo "Tagged v$$version. Run 'git push && git push --tags' to publish."
138
+ git tag -a "$$version" -m "Release $$version"; \
139
+ echo "Tagged $$version. Run 'git push && git push --tags' to publish."
135
140
 
136
141
  # Clean build artifacts
137
142
  clean:
@@ -159,6 +164,7 @@ help:
159
164
  @echo " test - Run tests"
160
165
  @echo " test-window - Run tests, including those that open a window"
161
166
  @echo " test-asan - Run tests and the smoke script under AddressSanitizer (macOS)"
167
+ @echo " test-c - Build and run the C tests of csrc/term (needs Zig 0.17)"
162
168
  @echo " gen - Regenerate the Cython layer from the CUI headers"
163
169
  @echo " lint - Lint with ruff (applies fixes)"
164
170
  @echo " lint-check - Lint with ruff (check only)"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cui-py
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Cython bindings for the cui UI framework
5
5
  Keywords: cui,ui,cython,bindings
6
6
  Author-Email: Shakeeb Alireza <shakfu@users.noreply.github.com>
@@ -11,7 +11,6 @@ License-File: thirdparty/cui/THIRD_PARTY.md
11
11
  License-File: thirdparty/cui/assets/fonts/LICENSE-Geist.txt
12
12
  License-File: thirdparty/cui/assets/fonts/LICENSE-Inter.txt
13
13
  License-File: thirdparty/cui/assets/fonts/LICENSE-Lucide.txt
14
- License-File: thirdparty/cui-repl/LICENSE
15
14
  Classifier: Development Status :: 3 - Alpha
16
15
  Classifier: Programming Language :: Python :: 3
17
16
  Classifier: Programming Language :: Python :: 3.11
@@ -48,7 +47,7 @@ def frame(ui: cui.Context) -> None:
48
47
  cui.App("Hello", 420, 300).run(frame)
49
48
  ```
50
49
 
51
- `examples/` has `hello.py`, `todo.py` (a port of CUI's tutorial app), `dashboard.py` and `showcase.py` (forms, charts, a node graph, a live Markdown editor and a console; `--png DIR` saves each page headless).
50
+ `examples/` has `hello.py`, `todo.py` (a port of CUI's tutorial app), `dashboard.py`, `notepad.py` (a text editor with a menu bar), `tictactoe.py` (menus and shortcuts from one action table) and `showcase.py` (forms, charts, a node graph, a live Markdown editor and a console; `--png DIR` saves each page headless).
52
51
 
53
52
  ## Install
54
53
 
@@ -141,7 +140,7 @@ The tests use this.
141
140
 
142
141
  ## Terminal on a pty
143
142
 
144
- `cui.Pty` runs a child process on a pseudo-terminal, and `ui.pty(id, p)` shows it. [libghostty-vt](https://lib.ghostty.org/vt/) 1.0.0 parses the output. The view code comes from [cui-repl](thirdparty/cui-repl/VENDORED). The Linux and macOS wheels include it. Windows has no pty, and `cui.PTY_AVAILABLE` is false there.
143
+ `cui.Pty` runs a child process on a pseudo-terminal, and `ui.pty(id, p)` shows it. [libghostty-vt](https://lib.ghostty.org/vt/) 1.0.0 parses the output. The Linux and macOS wheels include it. Windows has no pty, and `cui.PTY_AVAILABLE` is false there. The terminal code is in `csrc/term/` and its C tests in `tests/c/`; `docs/dev/terminal.md` covers its design.
145
144
 
146
145
  A source build leaves it off. To turn it on you need [Zig 0.17](https://lib.ghostty.org/vt/installing.html) and CMake 3.19 or later:
147
146
 
@@ -164,7 +163,7 @@ with cui.Pty(["python3", "-q"]) as p:
164
163
  - `p.write()` sends input, and `p.screen()` reads the screen as text.
165
164
  - A Pty works only on the thread that made it.
166
165
 
167
- `examples/term.py` is a terminal window.
166
+ `examples/term.py` is a terminal window. `examples/ide.py` puts one in a panel beside a file tree and editors.
168
167
 
169
168
  ## Errors instead of crashes
170
169
 
@@ -221,8 +220,9 @@ The output is committed. Run `make gen` after updating `thirdparty/cui`. Hand-wr
221
220
  | `make test` | headless tests, including one call to every generated method |
222
221
  | `make test-window` | also open a hidden window |
223
222
  | `make test-asan` | tests under AddressSanitizer (macOS) |
223
+ | `make test-c` | C tests of the terminal code in `csrc/term/` (needs Zig 0.17) |
224
224
  | `make qa` | lint, format check, mypy, tests |
225
225
 
226
226
  ## License
227
227
 
228
- MIT. The vendored CUI is MIT, with its fonts under OFL (Inter, Geist) and ISC (Lucide). See `thirdparty/cui/LICENSE`, `thirdparty/cui/THIRD_PARTY.md` and `thirdparty/cui/assets/fonts/`. A `CUI_PY_PTY` build also links cui-repl and libghostty-vt, both MIT. Their licenses go in `cui/licenses/`.
228
+ MIT. The vendored CUI is MIT, with its fonts under OFL (Inter, Geist) and ISC (Lucide). See `thirdparty/cui/LICENSE`, `thirdparty/cui/THIRD_PARTY.md` and `thirdparty/cui/assets/fonts/`. A `CUI_PY_PTY` build also links libghostty-vt, MIT. Its license goes in `cui/licenses/`.
@@ -22,7 +22,7 @@ def frame(ui: cui.Context) -> None:
22
22
  cui.App("Hello", 420, 300).run(frame)
23
23
  ```
24
24
 
25
- `examples/` has `hello.py`, `todo.py` (a port of CUI's tutorial app), `dashboard.py` and `showcase.py` (forms, charts, a node graph, a live Markdown editor and a console; `--png DIR` saves each page headless).
25
+ `examples/` has `hello.py`, `todo.py` (a port of CUI's tutorial app), `dashboard.py`, `notepad.py` (a text editor with a menu bar), `tictactoe.py` (menus and shortcuts from one action table) and `showcase.py` (forms, charts, a node graph, a live Markdown editor and a console; `--png DIR` saves each page headless).
26
26
 
27
27
  ## Install
28
28
 
@@ -115,7 +115,7 @@ The tests use this.
115
115
 
116
116
  ## Terminal on a pty
117
117
 
118
- `cui.Pty` runs a child process on a pseudo-terminal, and `ui.pty(id, p)` shows it. [libghostty-vt](https://lib.ghostty.org/vt/) 1.0.0 parses the output. The view code comes from [cui-repl](thirdparty/cui-repl/VENDORED). The Linux and macOS wheels include it. Windows has no pty, and `cui.PTY_AVAILABLE` is false there.
118
+ `cui.Pty` runs a child process on a pseudo-terminal, and `ui.pty(id, p)` shows it. [libghostty-vt](https://lib.ghostty.org/vt/) 1.0.0 parses the output. The Linux and macOS wheels include it. Windows has no pty, and `cui.PTY_AVAILABLE` is false there. The terminal code is in `csrc/term/` and its C tests in `tests/c/`; `docs/dev/terminal.md` covers its design.
119
119
 
120
120
  A source build leaves it off. To turn it on you need [Zig 0.17](https://lib.ghostty.org/vt/installing.html) and CMake 3.19 or later:
121
121
 
@@ -138,7 +138,7 @@ with cui.Pty(["python3", "-q"]) as p:
138
138
  - `p.write()` sends input, and `p.screen()` reads the screen as text.
139
139
  - A Pty works only on the thread that made it.
140
140
 
141
- `examples/term.py` is a terminal window.
141
+ `examples/term.py` is a terminal window. `examples/ide.py` puts one in a panel beside a file tree and editors.
142
142
 
143
143
  ## Errors instead of crashes
144
144
 
@@ -195,8 +195,9 @@ The output is committed. Run `make gen` after updating `thirdparty/cui`. Hand-wr
195
195
  | `make test` | headless tests, including one call to every generated method |
196
196
  | `make test-window` | also open a hidden window |
197
197
  | `make test-asan` | tests under AddressSanitizer (macOS) |
198
+ | `make test-c` | C tests of the terminal code in `csrc/term/` (needs Zig 0.17) |
198
199
  | `make qa` | lint, format check, mypy, tests |
199
200
 
200
201
  ## License
201
202
 
202
- MIT. The vendored CUI is MIT, with its fonts under OFL (Inter, Geist) and ISC (Lucide). See `thirdparty/cui/LICENSE`, `thirdparty/cui/THIRD_PARTY.md` and `thirdparty/cui/assets/fonts/`. A `CUI_PY_PTY` build also links cui-repl and libghostty-vt, both MIT. Their licenses go in `cui/licenses/`.
203
+ MIT. The vendored CUI is MIT, with its fonts under OFL (Inter, Geist) and ISC (Lucide). See `thirdparty/cui/LICENSE`, `thirdparty/cui/THIRD_PARTY.md` and `thirdparty/cui/assets/fonts/`. A `CUI_PY_PTY` build also links libghostty-vt, MIT. Its license goes in `cui/licenses/`.
@@ -20,6 +20,29 @@
20
20
 
21
21
  - [ ] `LogBuffer.total` and `TerminalBuffer.total` undercount when writes queued during a frame overflow the buffer: the dropped writes never reach C.
22
22
 
23
+ ## Terminal (`csrc/term`)
24
+
25
+ Carried over from cui-repl's TODO; `docs/dev/terminal.md` has the design.
26
+
27
+ - [ ] Run `make test-c` in CI. The wheel jobs build with `CUI_PY_PTY=ON` but run only pytest.
28
+
29
+ - [ ] Run `make test-c` and `tools/compat.sh` on Linux (X11, font fallbacks, `TIOCSCTTY`).
30
+
31
+ - [ ] Word and line selection: double- and triple-click through `ghostty_selection_gesture_*`. It may replace part of the drag code in `term_view.c`.
32
+
33
+ - [ ] Cross-thread wake. Replace the 10 Hz idle poll (2.7% of one core) with a reader thread that wakes the event loop.
34
+ - Preferred: a CUI patch adding a thread-safe `cui_app_wake`.
35
+ - Fallback: post an `NSEvent` on macOS and an X11 `ClientMessage` on Linux from `cuix.c`.
36
+ - Keep the 8 ms per-frame read budget; keep `fast_output_is_not_paced_by_frames` passing.
37
+
38
+ - [ ] Embed in myra-ui as a dock panel, started in myra-ui's `s.cwd`. `csrc/term/CMakeLists.txt` builds `cuiterm` given a `cui` target. Zig stays optional in myra: a `MYRA_UI_TERMINAL` option, off by default. Hang up the child when the panel closes; restart it on reopen.
39
+
40
+ - [ ] Real bold and italic faces instead of overstrike and upright text.
41
+
42
+ - [ ] Keys CUI has no code for (`[ ] ; ' \ \``, Insert, keypad), so Ctrl+[ and the like can be sent.
43
+
44
+ - [ ] IME composition, OSC 52 clipboard, hyperlinks.
45
+
23
46
  ## Not wrapped yet
24
47
 
25
48
  27 functions; `docs/dev/coverage.md` has the generator's reason for each. Grouped by what blocks them:
@@ -1,4 +1,4 @@
1
- /* cuipy_pty.c - cuipy_pty.h over cui-repl's session and term_view. */
1
+ /* cuipy_pty.c - cuipy_pty.h over csrc/term's session and term_view. */
2
2
  #include "cuipy_pty.h"
3
3
 
4
4
  #include "session.h"
@@ -1,5 +1,5 @@
1
1
  /* cuipy_pty.h - the api _core.pyx uses for cui.Pty. cuipy_pty.c implements it
2
- over thirdparty/cui-repl when CUI_PY_PTY is ON; cuipy_pty_stub.c otherwise. */
2
+ over csrc/term when CUI_PY_PTY is ON; cuipy_pty_stub.c otherwise. */
3
3
  #ifndef CUIPY_PTY_H
4
4
  #define CUIPY_PTY_H
5
5
 
@@ -0,0 +1,41 @@
1
+ # The terminal component: a pty, a libghostty-vt session and the CUI view that
2
+ # draws it. Needs the `cui` target. libghostty-vt's build runs `zig build`, so
3
+ # Zig 0.17 must be on PATH. Used by the extension and by tests/c.
4
+
5
+ # Without a version, ghostty reads it from `git tag --points-at HEAD`. Under
6
+ # build/ that is cui-py's checkout, and a tag such as 0.2.0 aborts its build.
7
+ set(_zig_flags "-Dversion-string=1.0.0")
8
+ # Zig targets the build host's CPU by default, and wheels run elsewhere.
9
+ # ghostty already builds generic macOS code; the arch is named for cross builds.
10
+ if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
11
+ list(APPEND _zig_flags "-Dtarget=x86_64-macos")
12
+ elseif(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
13
+ list(APPEND _zig_flags "-Dtarget=aarch64-macos")
14
+ elseif(NOT APPLE)
15
+ list(APPEND _zig_flags "-Dcpu=baseline")
16
+ endif()
17
+ set(GHOSTTY_ZIG_BUILD_FLAGS "${_zig_flags}" CACHE STRING "Extra zig build flags")
18
+ # Offline: -DFETCHCONTENT_SOURCE_DIR_GHOSTTY=/path/to/libghostty-vt-1.0.0
19
+ include(FetchContent)
20
+ FetchContent_Declare(ghostty
21
+ URL https://release.files.ghostty.org/libghostty-vt/1.0.0/libghostty-vt-1.0.0.tar.gz
22
+ URL_HASH SHA256=4a6ef758be721923e1969e7b81b443dcc92d8dd3fb5a39600c03a8817a753676
23
+ DOWNLOAD_EXTRACT_TIMESTAMP TRUE)
24
+ FetchContent_MakeAvailable(ghostty)
25
+ set(GHOSTTY_LICENSE "${ghostty_SOURCE_DIR}/LICENSE" PARENT_SCOPE)
26
+
27
+ set(CUI_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/cui")
28
+ add_library(cuiterm STATIC pty.c session.c term_view.c boxdraw.c cuix.c)
29
+ # The headers include "cui.h"; only cuix.c reads CUI's private cui_internal.h.
30
+ target_include_directories(cuiterm
31
+ PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" "${CUI_DIR}/include/cui"
32
+ PRIVATE "${CUI_DIR}/src")
33
+ target_compile_options(cuiterm PRIVATE -Wall -Wextra -Wshadow -Wstrict-prototypes)
34
+ if(CUI_TEXT_SHAPING)
35
+ target_compile_definitions(cuiterm PRIVATE CUI_TEXT_SHAPING)
36
+ endif()
37
+ target_link_libraries(cuiterm PUBLIC cui ghostty-vt-static)
38
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
39
+ # libghostty-vt calls shm_open, which is in librt before glibc 2.34.
40
+ target_link_libraries(cuiterm PUBLIC rt)
41
+ endif()
@@ -1,8 +1,8 @@
1
1
  /* boxdraw.h - box-drawing lines (U+2500-257F) and block elements (U+2580-259F)
2
2
  drawn as rectangles that fill the cell, so they join across cells; a font's
3
3
  glyphs leave gaps at a terminal's line height. */
4
- #ifndef CUI_REPL_BOXDRAW_H
5
- #define CUI_REPL_BOXDRAW_H
4
+ #ifndef CUIPY_TERM_BOXDRAW_H
5
+ #define CUIPY_TERM_BOXDRAW_H
6
6
 
7
7
  #include "cui.h"
8
8
 
@@ -1,9 +1,9 @@
1
1
  /* cuix.h - CUI internals a terminal widget needs that cui.h does not expose:
2
- typed text, keyboard and window focus, Tab, the wheel and the clipboard. cuix.c compiles
3
- them into the same unit as cui.c, so a CUI upgrade that renames a field breaks
4
- the build here and nowhere else. */
5
- #ifndef CUI_REPL_CUIX_H
6
- #define CUI_REPL_CUIX_H
2
+ typed text, keyboard and window focus, Tab, the wheel and the clipboard. cuix.c reads
3
+ them from CUI's private cui_internal.h, so a CUI upgrade that renames a field
4
+ breaks the build there and nowhere else. */
5
+ #ifndef CUIPY_TERM_CUIX_H
6
+ #define CUIPY_TERM_CUIX_H
7
7
 
8
8
  #include "cui.h"
9
9
 
@@ -1,6 +1,6 @@
1
1
  /* pty.h - a child process on a pseudo-terminal. POSIX only; no terminal emulation. */
2
- #ifndef CUI_REPL_PTY_H
3
- #define CUI_REPL_PTY_H
2
+ #ifndef CUIPY_TERM_PTY_H
3
+ #define CUIPY_TERM_PTY_H
4
4
 
5
5
  #include <stdbool.h>
6
6
  #include <stddef.h>
@@ -72,7 +72,7 @@ int session_open(session *s, char *const argv[], const char *cwd, uint16_t cols,
72
72
  if (!shell || !*shell) shell = "/bin/sh";
73
73
  char *login[] = {(char *)shell, "-l", NULL}; /* a login shell, as macOS terminals start */
74
74
  /* xterm-256color, not xterm-ghostty: the ghostty terminfo entry is often not installed */
75
- char *env[] = {"TERM=xterm-256color", "COLORTERM=truecolor", "TERM_PROGRAM=cui-repl", NULL};
75
+ char *env[] = {"TERM=xterm-256color", "COLORTERM=truecolor", "TERM_PROGRAM=cui-py", NULL};
76
76
  return pty_spawn(&s->pty, argv ? argv : login, cwd, env, cols, rows);
77
77
  }
78
78
 
@@ -1,7 +1,7 @@
1
1
  /* session.h - a shell on a pty, emulated by libghostty-vt. Knows nothing of CUI,
2
2
  so the tests drive it headless. One thread: every call from the same one. */
3
- #ifndef CUI_REPL_SESSION_H
4
- #define CUI_REPL_SESSION_H
3
+ #ifndef CUIPY_TERM_SESSION_H
4
+ #define CUIPY_TERM_SESSION_H
5
5
 
6
6
  #include "pty.h"
7
7
 
@@ -1,7 +1,7 @@
1
1
  /* term_view.h - a CUI widget that draws a session's screen and sends it keys,
2
2
  text, pastes, wheel scrolls, mouse and focus reports. Single-threaded: it pumps the pty each frame. */
3
- #ifndef CUI_REPL_TERM_VIEW_H
4
- #define CUI_REPL_TERM_VIEW_H
3
+ #ifndef CUIPY_TERM_TERM_VIEW_H
4
+ #define CUIPY_TERM_TERM_VIEW_H
5
5
 
6
6
  #include "cui.h"
7
7
  #include "session.h"