Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vim package #1459

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Add vim package #1459

merged 1 commit into from
Dec 10, 2024

Conversation

ianthomas23
Copy link
Collaborator

Add new package vim to the emscripten-3.1.58 branch for cockle and JupyterLite terminal. This is the first terminal command to use ncurses and some of the lessons here will be useful for subsequent commands.

  1. ncurses is a host requirement and it is important set up compile and link paths correctly to use the wasm ncurses rather than the OS version which will be eagerly found otherwise.
  2. Patching some of the OS term functions has been necessary as otherwise you have multiple conflicting function signatures, some with char* and some with const char*.
  3. Some runtime config files are packaged in the standard emscripten way into a vim.data file. Most of these files are from the vim source tarball, one is a new vimrc with some default options, and one is xterm-256color from ncurses.
  4. The vim.data is compressed using LZ4 by using the -sLZ4 linker flag. This achieves not quite 50% compression.
  5. Some of the vim config files are excluded, notably the docs and tutorial, to keep the vim.data as small as possible. Functionality remains to access these files which will need to be patched out later, when this is confirmed to be running OK in the terminal.

Generated file sizes are: vim.js 482 KB, vim.wasm 2.4 MB, vim.data 8.9 MB.

@ianthomas23 ianthomas23 added the enhancement New feature or request label Dec 10, 2024
@ianthomas23 ianthomas23 merged commit f53f74b into emscripten-3.1.58 Dec 10, 2024
1 check passed
@ianthomas23 ianthomas23 deleted the vim-3.1.58 branch December 10, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant