- // TODO: Implement Ctrl-C etc
-#if 0
- // Handle meta characters
- if( !(term->Flags & VT_FLAG_RAWIN) )
- {
- // Implementation options for Ctrl-C -> SIGINT
- // - Kernel-land: here in the VT
- // > Pros: No userland change needed
- // > Cons: Requires process groups
- // - User-land, in the shell
- // > Pros: Less threading changes
- // > Cons: Needs the shell to get all user input before the app, worse latency
- // > Won't work with bash etc
- switch(buf[0])
- {
- case '\3': // ^C
-
- break;
- }
- }
-#endif
-
- // Write
- if( MAX_INPUT_CHARS8 - term->InputWrite >= len ) {
- memcpy( &term->InputBuffer[term->InputWrite], buf, len );
- }
- else {
- memcpy( &term->InputBuffer[term->InputWrite], buf, MAX_INPUT_CHARS8 - term->InputWrite );
- memcpy( &term->InputBuffer[0], buf, len - (MAX_INPUT_CHARS8 - term->InputWrite) );
- }
- // Roll the buffer over
- term->InputWrite += len;
- term->InputWrite %= MAX_INPUT_CHARS8;
- if( (term->InputWrite - term->InputRead + MAX_INPUT_CHARS8)%MAX_INPUT_CHARS8 < len ) {
- term->InputRead = term->InputWrite + 1;
- term->InputRead %= MAX_INPUT_CHARS8;
- }