SkillAgentSearch skills...

Readline

golang wrapper for readline(3) library. Signal SIGWINCH handling included.

Install / Use

/learn @shavac/Readline
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

  • ReadLine Wrapper for Golang * ===============================

Originally cloned from https://bitbucket.org/taruti/go-readline

Former code compile successfully with example but panic while window resizing.So i clone and patch it with signal SIGWINCH handling with go codes.


package main

import "github.com/shavac/readline"

func main() {
    prompt := "by your command> ";
    //loop until ReadLine returns nil (signalling EOF)
L:
    for {
	    switch result := readline.ReadLine(&prompt); true {
	    case result == nil:
	    	 println()
	    	 break L //exit loop with EOF(^D)
	    case *result != "": //ignore blank lines
		    println(*result);
		    readline.AddHistory(*result); //allow user to recall this line
	    }
    }
}

View on GitHub
GitHub Stars19
CategoryDevelopment
Updated5y ago
Forks16

Languages

Go

Security Score

60/100

Audited on Oct 24, 2020

No findings