-
-
Save zeekay/8fec9a9c612ad30f6d75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var blessed = require('blessed'); | |
var screen = blessed.screen(); | |
var box = blessed.box({ | |
bottom: 0, | |
left: 'center', | |
height: 5, | |
width: '100%', | |
content: 'Hello {bold}world{/bold}', | |
tags: true, | |
border: { | |
type: 'line' | |
}, | |
style: { | |
fg: 'green', | |
bg: 'black', | |
border: { | |
fg: '#cccccc' | |
}, | |
} | |
}); | |
screen.append(box); | |
form = blessed.Form({ | |
}); | |
box.append(form); | |
var text = blessed.Textbox({ | |
content: 'input', | |
keys: true, | |
inputOnFocus: true, | |
border: { | |
type: 'line' | |
} | |
}); | |
box.append(text); | |
text.key('enter', function (ch, key) { | |
// Append text.getValue(), send it to IRC server, etc. | |
text.clearValue() | |
text.focus() | |
screen.render(); | |
}); | |
text.key(['escape'], function (ch, key) { | |
return process.exit(0); | |
}); | |
text.focus(); | |
screen.render(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment