Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #1015515 // React to last line typed in terminal

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (10263L/73K).

!7

static JLabel lblTime;

p-tt {
  putBesideMemoryView(lblTime = jlabel());
    
  while licensed {
    long time = sysNow();
    S contents = ocr_terminalContents();
    setText(lblTime, " " + elapsedMS(time) + " ms | ");
    if (empty(contents)) continue;
    S line = lastLine(rtrim(contents));
    line = dropSuffix(diamond(), line);
    print("Line: " + line);
    int i = indexOf(line, " $ ");
    if (i < 0) continue;
    S cmd = trimSubstring(line, i+3);
    if (eqic(cmd, "list"))
      infoBox("You mean: ls");
  }
}

Author comment

Began life as a copy of #1015514

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1015515
Snippet name: React to last line typed in terminal
Eternal ID of this version: #1015515/6
Text MD5: db73992fc8341c605eacb72b7d72b896
Transpilation MD5: b81c15fbfb561f2cf48475f479ce9904
Author: stefan
Category: javax / imaging
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-15 12:14:19
Source code size: 549 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 318 / 772
Version history: 5 change(s)
Referenced in: [show references]