Giter VIP home page Giter VIP logo

dart_console's People

Contributors

averynortonsmith avatar domesticmouse avatar erf avatar fafre avatar md-weber avatar mit-mit avatar mkustermann avatar ssaundersla avatar timsneath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dart_console's Issues

If stdin is closed cursorPosition throws a RangeError

if stdin is closed (seems to be within docker)
hen the call to Console.cursorPosition will fail.
RangeError: Invalid value: Not in inclusive range 0..1114111: -1
new String.fromCharCode (dart:core-patch/string_patch.dart:45)
Console.cursorPosition (package:dart_console/src/console.dart:304)

looks like the results from the read need to be checked for -1 (end of file) before trying to decode as a char code.

Support window resize events

I'd like to suggest adding an API for a callback for windows resize event.

If you for example are building a text editor, you'd like to redraw content on resize.

Last symbol cannot be deleted with delete key or Ctrl-D when using Console().readLine()

When using Console().readLine() The last symbol cannot be deleted by pressing the delete key or Ctrl-D if the cursor is in front of that symbol.

Steps to reproduce

  1. Run the example example/readline.dart
  2. Type aa
  3. Tap the left arrow two times so that the cursor is infront of both as
  4. Tap delete or Ctrl-D
  5. The first a is deleted as expected
  6. Tap delete or Ctrl-D again
  7. The second a is not deleted, even though it should be.

I think the problem is with the line

if (index < buffer.length - 1) {

which should just be if (index < buffer.length) {.

Nested arrays expressed as individual elements

Hi i'm trying to follow your library to learn a bit more about dart ffi and i'm curious about this section

where the unix definition is

// cc_t c_cc[NCCS]; /* control chars */

but you chose to do

  // This replaces c_cc[20]
  @Int8()
  int c_cc0;
  @Int8()
  int c_cc1;
  @Int8()
  int c_cc2;
  @Int8()
  int c_cc3;
  @Int8()
  int c_cc4;
  @Int8()
  int c_cc5;
  @Int8()
  int c_cc6;
  @Int8()
  int c_cc7;
  @Int8()
  int c_cc8;
  @Int8()
  int c_cc9;
  @Int8()
  int c_cc10;
  @Int8()
  int c_cc11;
  @Int8()
  int c_cc12;
  @Int8()
  int c_cc13;
  @Int8()
  int c_cc14;
  @Int8()
  int c_cc15;
  @Int8()
  int c_cc16; // VMIN
  @Int8()
  int c_cc17; // VTIME
  @Int8()
  int c_cc18;
  @Int8()
  int c_cc19;

is there a reference anywhere than explains this?
taken from here

// This replaces c_cc[20]

Accessing `cursorPosition` may print debugging information

If seems that accessing Console.cursorPosition is implemented via writing escape sequences to stdout and waiting in stdin to receive the answer. That may be inherent in how terminals work.

That poses a problem when pasting longer text into the command prompt, since one may access cursorPosition when there's remaining data to be read. This will cause the cursorPosition to get into bad state (probably because it sees this other pasted - but not-yet-read data instead of the answer from cursor-position query).

It's hard to work around this problem with the current API, since one doesn't know whether there's data available before accessing cursorPosition.

One suggestion I have is to provide a tryReadKey()

class Console {
    Key readKey() { ... }
    Key? tryReadKey() { ... }
}

If stdin supports non-blocking IO, one could

  • dup2() the stdin file descriptor (to avoid clashing with other dart:io functionality that assumes stdin fd is blocking)
  • make the copied file descriptor non-blocking
  • try to read data: which may be successful if there's data available (return Key), or not if no data is available (return null)

This would give applications the option to manually call tryReadKey() until it returns null and only ask for cursorPosition afterwards.

Consider adding italic text style?

Would you consider adding 'italic' as a text style? it uses ansi '3' in the same position as 'bold' uses '1'. iTerm supports it, btw.
--Rob

String ansiSetTextStyles(
{bool bold = false,
bool underscore = false,
bool blink = false,
bool inverted = false,
bool italic = false}) {
var styles = [];
if (bold) styles.add(1);
if (underscore) styles.add(4);
if (blink) styles.add(5);
if (inverted) styles.add(7);
if (italic) styles.add(3);
return '\x1b[${styles.join(";")}m';
}

How to build?

Sorry, beginner's question. I got the code for kilo.dart, but I can't seem to build it. Do I have to put the code for dart_console somewhere manually? Where??

Support async input

I'd like to read input async, so that i can have a game loop going, without locking up the loop waiting for input.

Is this something you think is possible to implement or you'd like to add?

Type errors in dart_console-0.6.1 on Dart VM version: 2.9.0-17.0.dev.flutter-7e72c9ae7e

Probably caused by ed52d5b , though I'm not sure why the type of FillConsoleOutputCharacter changed.

../../../../../.pub-cache/hosted/pub.dartlang.org/dart_console-0.6.1/lib/src/ffi/win/termlib-win.dart:90:58: Error: The argument type 'Pointer<Uint32>' can't be assigned to the parameter type 'Pointer<Int32>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Uint32' is from 'dart:ffi'.
 - 'Int32' is from 'dart:ffi'.
        outputHandle, ' '.codeUnitAt(0), consoleSize, 0, pCharsWritten);
                                                         ^
../../../../../.pub-cache/hosted/pub.dartlang.org/dart_console-0.6.1/lib/src/ffi/win/termlib-win.dart:95:63: Error: The argument type 'Pointer<Uint32>' can't be assigned to the parameter type 'Pointer<Int32>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Uint32' is from 'dart:ffi'.
 - 'Int32' is from 'dart:ffi'.
        outputHandle, bufferInfo.wAttributes, consoleSize, 0, pCharsWritten);

Game: Run Console in Flutter Web?

Hello,

I develop a roguelike game that runs in a Console.

To showcase the game I would like to embedd the Console in Flutter Web.

I realize that this is probably not possible due to technical limitations.

Or could it be done?

Thank you.

Pasting clipboard content to readLine pastes only first character

Tested in MacOS (no other O/S available for me). Create a simple Dart console app. Use console.readLine() to read a line.

Pasting clipboard content (%V in MacOS) doesn't work as expected. Only the first character would be pasted. I tried to write my own loop to use console.readKey() to get a full line. Same buggy behavior.

Using Dart's own stdin.readByteSync() in a loop to get a line does not have the same problem. %V works perfectly in that case.

Extend `Console.readLine()` API to allow tab-completion of commands in a prompt

A very common thing to do when developing interactive CLIs with prompts is to allow code completion of commands typed into the prompt.

The current API of Console.readLine() makes this a little difficult, because it maintains it's own internal buffer of text that was inserted and its own cursor position. The callback parameter that can be supplied cannot modify this internal state of readLine() and therefore not e.g. auto complete.

A simple change that would allow tab-completion is the following

diff --git a/lib/src/console.dart b/lib/src/console.dart
index 9f7a7a0..48a2f58 100644
--- a/lib/src/console.dart
+++ b/lib/src/console.dart
@@ -534,7 +534,7 @@ class Console {
       {bool cancelOnBreak = false,
       bool cancelOnEscape = false,
       bool cancelOnEOF = false,
-      void Function(String text, Key lastPressed)? callback}) {
+      String? Function(String text, Key lastPressed)? callback}) {
     var buffer = '';
     var index = 0; // cursor position relative to buffer, not screen
 
@@ -650,7 +650,16 @@ class Console {
       write(buffer); // allow for backspace condition
       cursorPosition = Coordinate(screenRow, screenColOffset + index);
 
-      if (callback != null) callback(buffer, key);
+      if (callback != null) {
+        final left = buffer.substring(0, index);
+        final right = buffer.substring(index);
+
+        final leftReplacement = callback(left, key);
+        if (leftReplacement != null) {
+          index = leftReplacement.length;
+          buffer = leftReplacement + right;
+        }
+      }
     }
   }
 }

Using this change one can get tab-completion e.g. with this example:

import 'package:dart_console/dart_console.dart';

final console = Console.scrolling();

final commands = ['java', 'dart', 'pascal', 'delphi'];
String? completeCommand(String buffer) {
  if (buffer.isEmpty) return null;
  for (final command in commands) {
    if (command.startsWith(buffer) && buffer.length < command.length) {
      return command;
    }
  }
  return null;
}

String? suggestedCompletion;
String? completion(String text, Key lastPressed) {
  if (lastPressed.isControl) {
    final completion = suggestedCompletion;
    suggestedCompletion = null;
    if (lastPressed.controlChar == ControlCharacter.tab && completion != null) {
      // Write remaining characters to the screen.
      console.write(completion.substring(text.length));
      // Let the `Console.readLine()` API know the replacement text.
      return completion;
    }
    return null;
  }

  final int prefixStart = text.lastIndexOf(' ');
  var completion = completeCommand(text.substring(prefixStart + 1));
  if (completion != null) {
    if (prefixStart >= 0) {
      completion = text.substring(0, prefixStart) + ' ' + completion;
    }

    suggestedCompletion = completion;

    // Write the text that can be tab-completed in different color.
    final old = console.cursorPosition;
    console.setForegroundColor(ConsoleColor.brightWhite);
    console.write(completion.substring(text.length));
    console.cursorPosition = old;

    // Reset color to what it used to be.
    console.setForegroundColor(ConsoleColor.brightGreen);
  }

  return null;
}

void main() {
  while (true) {
    console.setForegroundColor(ConsoleColor.brightBlue);
    console.write('>>> ');
    console.resetColorAttributes();
    console.setForegroundColor(ConsoleColor.brightGreen);
    final response = console.readLine(cancelOnEOF: true, callback: completion);

    if (response == null) break;
    print(response.toUpperCase());
  }
}

Though maybe a more direct API of the callback to the internal buffer and index would be better.

Would be wonderful have a way to build on package:dart_console and get tab-completion working.

/cc @timsneath

window resize event

I understand that is not very complicate to get the resize event for unix terminals like seen here
but is it actually possible to do it for windows?

PR for multi-line input

Hi, Tim. Are you open to a pull request? I would like to use your dart_console library in a project I'm starting, but I was hoping for a readline that would handle using the up and down keys to scroll through previous lines. I see from your comment in console.dart ("TODO: Add multi-line input.") that this is an interest of yours as well. I have a local copy with this change if you would like to review it.

Methods missing from docs / package on pub.dev

It seems that there's a mismatch between the source code and the documentation / examples / code on pub.dev. For example console.dart shows a named constructor Console.scrolling(), but this is missing from the documentation and not present in the code downloaded from pub.dev.

Is there a way to resolve this mismatch? I'd love to be able to use the scrollback functionality.

windowWidth and windowHeight do not update on window resize (linux)

Like the title says, the fields console.windowWidth and console.windowHeight work correctly, but do not update after a window resize. Here's an example:

import 'package:dart_console/dart_console.dart';
import 'dart:io';

void main() {
  final console = Console();
  while (true) {
    var key = console.readKey();
    if (key.char == 'q') {
      break;
    } else {
      // Press some keys, resize the window, press some more keys
      stdout.writeln('${console.windowWidth}x${console.windowHeight}'); // Does not update
      stdout.writeln('${stdout.terminalColumns}x${stdout.terminalLines}'); // Updates
    }
  }
}

This was observed in gnome-terminal and vscode's integrated terminal.

Console.writeLine does not align correctly with characters that do not have width 1

When using Console.writeLine() to print strings that have either tabs or embedded ANSI codes. The resulting output is longer than the width of the screen so it appears that there are extra new lines but it's just the actual lines wrapped before the actual newline is printed.

I have worked around it with just using write() with an newline in the supplied string.

I double checked and the behavior is not present in 1.0. The change to have writeLine() call writeAligned() is likely the culprit and the non-single width characters are causing the alignment to be miscalculated.

I don't know this if this is even reasonable to fix as it would require knowing how the terminal is actually rendering the string.

So this is mostly to document, and suggest maybe changing current writeLine to writeLineAlinged and having writeLine behave as previously.

The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.

I run into this error.

Downloading Linux x64 Dart SDK 3.1.2...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  8  198M    8 16.0M    0     0  29.2M      0  0:00:06 --:--:--  0:00:06 29.2M
 36  198M   36 72.0M    0     0  46.6M      0  0:00:04  0:00:01  0:00:03 46.6M
 90  198M   90  179M    0     0  71.2M      0  0:00:02  0:00:02 --:--:-- 71.2M
[10](https://github.com/customer/cnct-ui/actions/runs/8566330160/job/23481014239?pr=385#step:6:11)0  198M  100  198M    0     0  75.6M      0  0:00:02  0:00:02 --:--:-- 75.6M
Installing cnct command line application...
/home/runner/work/cnct-ui/cnct-ui/cnct_sidekick/tool/install.sh: 37: [[: not found
/home/runner/work/cnct-ui/cnct-ui/cnct_sidekick/tool/install.sh: 37: Linux: not found
- Getting dependencies
✔ Getting dependencies
- Bundling assets
✔ Bundling assets
- Compiling sidekick cli
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:35:22: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
    final dwMode = (~CONSOLE_MODE.ENABLE_ECHO_INPUT) &
                     ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:36:[11](https://github.com/customer/cnct-ui/actions/runs/8566330160/job/23481014239?pr=385#step:6:12): Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        (~CONSOLE_MODE.ENABLE_PROCESSED_INPUT) &
          ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:37:11: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        (~CONSOLE_MODE.ENABLE_LINE_INPUT) &
          ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:38:11: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        (~CONSOLE_MODE.ENABLE_WINDOW_INPUT);
          ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:44:20: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
    final dwMode = CONSOLE_MODE.ENABLE_ECHO_INPUT &
                   ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:45:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_EXTENDED_FLAGS &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:46:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_INSERT_MODE &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:47:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_LINE_INPUT &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:48:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_MOUSE_INPUT &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:49:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_PROCESSED_INPUT &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:50:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_QUICK_EDIT_MODE &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:51:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_VIRTUAL_TERMINAL_INPUT;
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:111:33: Error: The getter 'STD_HANDLE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'STD_HANDLE'.
    outputHandle = GetStdHandle(STD_HANDLE.STD_OUTPUT_HANDLE);
                                ^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:1[12](https://github.com/customer/cnct-ui/actions/runs/8566330160/job/23481014239?pr=385#step:6:13):32: Error: The getter 'STD_HANDLE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'STD_HANDLE'.
    inputHandle = GetStdHandle(STD_HANDLE.STD_INPUT_HANDLE);
                               ^^^^^^^^^^
Error: AOT compilation failed
Generating AOT kernel dill failed!
Compilation failed. Trying dart pub upgrade (Retry 1)
- Compiling sidekick cli with updated dependencies
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:35:22: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
    final dwMode = (~CONSOLE_MODE.ENABLE_ECHO_INPUT) &
                     ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:36:11: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        (~CONSOLE_MODE.ENABLE_PROCESSED_INPUT) &
          ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:37:11: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        (~CONSOLE_MODE.ENABLE_LINE_INPUT) &
          ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:38:11: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        (~CONSOLE_MODE.ENABLE_WINDOW_INPUT);
          ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:44:[20](https://github.com/customer/cnct-ui/actions/runs/8566330160/job/23481014239?pr=385#step:6:21): Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
    final dwMode = CONSOLE_MODE.ENABLE_ECHO_INPUT &
                   ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:45:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_EXTENDED_FLAGS &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:46:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_INSERT_MODE &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:47:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_LINE_INPUT &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:48:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_MOUSE_INPUT &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:49:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_PROCESSED_INPUT &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:50:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_QUICK_EDIT_MODE &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:51:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_VIRTUAL_TERMINAL_INPUT;
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:111:33: Error: The getter 'STD_HANDLE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'STD_HANDLE'.
    outputHandle = GetStdHandle(STD_HANDLE.STD_OUTPUT_HANDLE);
                                ^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:112:32: Error: The getter 'STD_HANDLE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'STD_HANDLE'.
    inputHandle = GetStdHandle(STD_HANDLE.STD_INPUT_HANDLE);
                               ^^^^^^^^^^
Error: AOT compilation failed
Generating AOT kernel dill failed!
Compilation failed again. Trying dart pub upgrade --major-versions (Retry 2)
- Compiling sidekick cli with major updated dependencies
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:35:[22](https://github.com/customer/cnct-ui/actions/runs/8566330160/job/23481014239?pr=385#step:6:23): Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
    final dwMode = (~CONSOLE_MODE.ENABLE_ECHO_INPUT) &
                     ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:36:11: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        (~CONSOLE_MODE.ENABLE_PROCESSED_INPUT) &
          ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:37:11: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        (~CONSOLE_MODE.ENABLE_LINE_INPUT) &
          ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:38:11: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        (~CONSOLE_MODE.ENABLE_WINDOW_INPUT);
          ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:44:20: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
    final dwMode = CONSOLE_MODE.ENABLE_ECHO_INPUT &
                   ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:45:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_EXTENDED_FLAGS &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:46:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_INSERT_MODE &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:47:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_LINE_INPUT &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:48:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_MOUSE_INPUT &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:49:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_PROCESSED_INPUT &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:50:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_QUICK_EDIT_MODE &
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:51:9: Error: The getter 'CONSOLE_MODE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CONSOLE_MODE'.
        CONSOLE_MODE.ENABLE_VIRTUAL_TERMINAL_INPUT;
        ^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:111:33: Error: The getter 'STD_HANDLE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'STD_HANDLE'.
    outputHandle = GetStdHandle(STD_HANDLE.STD_OUTPUT_HANDLE);
                                ^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart:112:[32](https://github.com/customer/cnct-ui/actions/runs/8566330160/job/23481014239?pr=385#step:6:33): Error: The getter 'STD_HANDLE' isn't defined for the class 'TermLibWindows'.
 - 'TermLibWindows' is from 'package:dart_console2/src/ffi/win/termlib_win.dart' ('../../../../.pub-cache/hosted/pub.dev/dart_console2-3.1.0/lib/src/ffi/win/termlib_win.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'STD_HANDLE'.
    inputHandle = GetStdHandle(STD_HANDLE.STD_INPUT_HANDLE);
                               ^^^^^^^^^^
Error: AOT compilation failed
Generating AOT kernel dill failed!
Compilation with updated and major updated dependencies failed. Restoring pubspec.lock

I'm unsure why dart_console2-3.1.0 is pulled at all. My pubspec.lock file contains

  dart_console2:
    dependency: transitive
    description:
      name: dart_console2
      sha256: "300833ffdd8c465d454cb5007c7f29d28ac8246af5abd922f8c490e1e87c894f"
      url: "https://pub.dev"
    source: hosted
    version: "3.0.0"

I pulled the dependencies on macos (where everything works. Linux seems to be incompatible with "3.0.0" and pulls the latest version.

Versionbump win32 to 3.0.0

Hi Tim,
is there anything I can do to help make the version bump for the win32 dependency? file_picker has already adopted the new win32 and due to transitive dependencies of msix I end up writing this issue :)

`Console.readLine()` doesn't allow users to paste text into terminal

Normally one can past text into apps running on terminals: Be it a shell or interactive tools e.g. gdb one can paste text into the terminal prompt.

Using package:dart_consoles Console.readLine() api this is not possible, instead it will only take the first character and discard the rest of the pasted text. Simple reproduction

% dart example/readline_scrolling.dart
>>>

and try pasting some text with middle mouse button on linux.

The root cause of that is that Console.readLine() is implemented by repeatedly calling Console.readKey() which switches in/out of raw mode. The switching in/out of raw mode will cause remaining buffered input to be discarded.

The issue itself can be fixed by this small change

diff --git a/lib/src/ffi/unix/termlib_unix.dart b/lib/src/ffi/unix/termlib_unix.dart
index 1ef85ef..5d30b5c 100644
--- a/lib/src/ffi/unix/termlib_unix.dart
+++ b/lib/src/ffi/unix/termlib_unix.dart
@@ -52,7 +52,7 @@ class TermLibUnix implements TermLib {
       ..ref.c_ispeed = origTermIOS.c_ispeed
       ..ref.c_oflag = origTermIOS.c_ospeed;
 
-    tcsetattr(STDIN_FILENO, TCSAFLUSH, newTermIOSPointer);
+    tcsetattr(STDIN_FILENO, TCSADRAIN, newTermIOSPointer);
 
     calloc.free(newTermIOSPointer);
   }
@@ -60,7 +60,7 @@ class TermLibUnix implements TermLib {
   @override
   void disableRawMode() {
     if (nullptr == _origTermIOSPointer.cast()) return;
-    tcsetattr(STDIN_FILENO, TCSAFLUSH, _origTermIOSPointer);
+    tcsetattr(STDIN_FILENO, TCSADRAIN, _origTermIOSPointer);
   }
 
   TermLibUnix() {

/cc @timsneath Do you think this is the right fix? (I'd really like to have the copy&paste into command prompt working - it's such an important use case)

Problem with UTF8 terminal

I was having problems with extended chars in a linux terminal.
When I typed "è" I got "Ã".
Running the rawkeys example I got the following output:
c3 (Ã)
a8 (¨)

Giving a look at the Key.readKey function I saw this comment:

   ///  ... , certain keys may
  /// be represented by multiple control key sequences. An example showing
  /// basic key handling can be found in the `example/command_line.dart`
  /// file in the package source code.

But I could not find the example "command_line"

So I did the following:
I copied the readKey function into an extension function and I did the following changes:
Original:

 Key readKey() {
    Key key;
    int charCode;
    int codeUnit = 0;

    rawMode = true;
    while (codeUnit <= 0) {
      codeUnit = stdin.readByteSync();
    }

    if (codeUnit >= 0x01 && codeUnit <= 0x1a) {

....

Modified:

  Key readSystemKey() {
    Key key;
    int charCode;
    var codeUnit;
    var bytes = <int>[];

    rawMode = true;
    while (key == null) {
      codeUnit = 0;
      while (codeUnit <= 0) {
        codeUnit = stdin.readByteSync();
      }

      if (codeUnit >= 0x01 && codeUnit <= 0x1a) {
...

Original end of method:

    } else {
      // assume other characters are printable
      key = Key.printable(String.fromCharCode(codeUnit));
    }
    rawMode = false;
    return key;
  }

Modified end of method:

      } else {
        // assume other characters are printable
        try {
          bytes.add(codeUnit);
          key = Key.printable(systemEncoding.decode(bytes));
          bytes.clear();
        } on FormatException catch (_) {
          if (bytes.length > 4) {
            rethrow;
          }
        }
      }
    }
    rawMode = false;
    return key;
  }

It works for my needs, but probably this logic should be added in other points of the package and tested with different OSs.
Another option would be to let the user set a specific encoding, if needed.

Let me know what do you think about.

Example not working

Your example in the README:

import 'package:dart_console/dart_console.dart';

main() {
  final console = Console();

  console.clearScreen();
  console.resetCursorPosition();

  console.writeAligned(
      'Console size is ${console.windowWidth} cols and ${console.windowHeight} rows.',
      TextAlignment.Center);
  console.writeLine();

  return 0;
}

doesn't work because Console.writeAligned doesn't exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.