-
Notifications
You must be signed in to change notification settings - Fork 113
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
wasm Error : JavaScript execution returned a result of an unsupported type #779
Comments
I don't know if that answers your question, but I've compiled |
Amazing! Thanks! |
The TestFlight version of a-Shell mini with |
thank you. this is a really promising progress! I have found three bugs of nnn so far:
|
Hi, thank you for raising all these points. There's a new a-Shell version out on TestFlight. It displays file names with UTF-8 characters, it has better copy and move (that one was tricky: the previous version was launching "cp", but asking for confirmation in an invisible screen. The new one asks for confirmation using hacks). I'm not sure about the issue with the escape key. |
Thanks. I’ve just tested it and observed the following issues:
I haven’t had enough time to test with various file names yet, but it seems characters including ‘ㅇ’ may be causing problems. An example of a file name: On second thought, the ‘jongseong’ of Korean characters might actually be causing this issue. Please refer to the following quotes from Wikipedia: https://en.wikipedia.org/wiki/Hangul Morpho-syllabic blocksExcept for a few grammatical morphemes prior to the twentieth century, no letter stands alone to represent elements of the Korean language. Instead, letters are grouped into syllabic or morphemic blocks of at least two and often three: a consonant or a doubled consonant called the initial (초성, 初聲 choseong syllable onset), a vowel or diphthong called the medial (중성, 中聲 jungseong syllable nucleus), and, optionally, a consonant or consonant cluster at the end of the syllable, called the final (종성, 終聲 jongseong syllable coda). When a syllable has no actual initial consonant, the null initial ㅇ ieung is used as a placeholder. (In the modern Korean alphabet, placeholders are not used for the final position.) Thus, a block contains a minimum of two letters, an initial and a medial. Although the Korean alphabet had historically been organized into syllables, in the modern orthography it is first organized into morphemes, and only secondarily into syllables within those morphemes, with the exception that single-consonant morphemes may not be written alone. The sets of initial and final consonants are not the same. For instance, ㅇ ng only occurs in final position, while the doubled letters that can occur in final position are limited to ㅆ ss and ㄲ kk. Not including obsolete letters, 11,172 blocks are possible in the Korean alphabet.[77] |
I have tried to compile various TUI file managers into WebAssembly, but all my attempts have failed. Subsequently, I decided to develop a new file manager myself, with assistance from ChatGPT, as I am not actually a programmer.
My development is still in its very early stages. I am frustrated to learn that the termios library is not compatible with WebAssembly. Additionally, I am wondering why my compiled file manager is occasionally terminated with the following error:
wasm Error: JavaScript execution returned a result of an unsupported type
Please find below the source code of my development so far:
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#define MAX_PATH 1024
#define MAX_ENTRIES 1024
struct entry {
char name[MAX_PATH];
int is_dir;
int selected;
};
struct entry entries[MAX_ENTRIES];
int num_entries = 0;
int current_pos = 0;
int selected_count = 0;
void get_entries(char *path) {
DIR *dir = opendir(path);
struct dirent *entry;
num_entries = 0;
}
void draw() {
printf("\033[H\033[J"); // Clear screen
printf("Current directory: %s\n\n", getcwd(NULL, 0));
}
void select_all() {
for (int i = 0; i < num_entries; i++) {
entries[i].selected = 1;
}
selected_count = num_entries;
}
void invert_selection() {
for (int i = 0; i < num_entries; i++) {
entries[i].selected = !entries[i].selected;
}
selected_count = num_entries - selected_count;
}
void clear_selections() {
for (int i = 0; i < num_entries; i++) {
entries[i].selected = 0;
}
selected_count = 0;
}
int main() {
char cwd[MAX_PATH];
getcwd(cwd, sizeof(cwd));
get_entries(cwd);
draw();
}
The text was updated successfully, but these errors were encountered: