How to use the blessed.textarea function in blessed

To help you get started, we’ve selected a few blessed examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github radareorg / radare2-extras / blessr2 / index.js View on Github external
bg: 'red',
        fg: 'white'
    };

    function isaBox(x) {
        if (x.indexOf('ag') != -1)
            return true;
        return false;
    }

    function isaText(x) {
        return (x[0] == ':');
    }
    let res = undefined;
    if (isaText(name)) {
        res = blessed.textarea(obj);
        res.select = function() { /* do nothing */ };
    } else if (isaBox(name)) {
        res = blessed.box(obj);
        res.select = function() { /* do nothing */ };
    } else {
        obj.selectedFg = 'white';
        obj.selectedBg = '#000070';
        res = blessed.list(obj);
        res.setContent = function(x) {
            if (typeof x === 'string') {
                res.setItems(x.split('\n'));
            }
        }
    }
    res.cmd = name;
    return res;
github CamHenlin / imessageclient / app.js View on Github external
screen.key('n', function(ch, key) {
	var newChatBox = blessed.textarea({
		parent: screen,
		// Possibly support:
		// align: 'center',
		fg: 'blue',
		height: '15%',
		border: {
			type: 'line'
		},
		width: '75%',
		top: '35%',
		left: '12.5%',
		label: "New Conversation - type in contact iMessage info and hit enter"
	});

	newChatBox.on('focus', function() {
		newChatBox.readInput(function(data) {});
github irrationalistic / nchat / display.js View on Github external
right: 0,
    bottom: 3,
    content: 'Welcome!',
    tags: true,
    scrollable: true,
    alwaysScroll: true,
    scrollbar: {
      bg: 666
    },
    style: {
      fg: 'white'
    }
  });

  // Input box
  var messageInput = blessed.textarea({
    bottom: 0,
    left: 0,
    right: 0,
    height: 3,
    input: true,
    inputOnFocus: true,
    mouse: true,
    clickable: true,
    focused: true,
    content: '',
    border: {
      type: 'line'
    },
    style: {
      fg: 'white',
    }
github RodrigoEspinosa / gitter-cli / lib / ui / message-input.js View on Github external
exports = module.exports = function (context) {
  var input = Blessed.textarea({
    bottom: 0,
    height: 3,
    autoPadding: true,
    inputOnFocus: true,
    padding: {
      top: 1,
      left: 2
    },
    style: Styles['message-input']
  });

  return input;
};
github golbin / git-commander / view / editor.js View on Github external
var init = function (screen) {
  styles.layout.parent = screen;

  layout = blessed.layout(styles.layout);

  styles.textarea.parent = layout;
  styles.menubar.parent  = layout;

  textarea = blessed.textarea(styles.textarea);
  menubar  = blessed.listbar(styles.menubar);

  return {
    layout  : layout,
    textarea: textarea,
    menubar : menubar
  };
};
github goferito / termllo / lib / ui.js View on Github external
fg: 'green',
      },
      border: {
        fg: 'green',
      },
      focus: {
        label: {
          bold: true,
        },
        border: {
          bold: true,
        }
      }
    },
  })
  const descrBox = blessed.textarea({
    parent: cardForm,
    name: 'desc',
    top: 3,
    keys: true,
    vi: true,
    inputOnFocus: true,
    border: {
      type: 'line',
    },
    label: ` Description `,
    style: {
      label: {
        fg: 'green',
        left: '50%',
      },
      border: {
github hundredrabbits / Left / cli / main.js View on Github external
fullUnicode: true,
});

const naviEl = blessed.list({
  width: '30%-1',
  height: '100%-2',
  left: 2,
  top: 1,
  style: {
    border: {
      fg: 'white',
    }
  },
});

const textArea = blessed.textarea({
  width: '70%-1',
  height: '100%-2',
  top: 2,
  left: '30%',
  keys: true,
  inputOnFocus: true,
  style: {
    border: {
      fg: 'white',
    }
  },
});

const ed = new Editor({
  parent: screen,
  width: '70%-1',
github ztuowen / bilicom / app.js View on Github external
function drawFooter(){
        inbox = blessed.textarea({
            bottom: 1,
            height: 1,
            left: '0%',
            width: '100%',
            inputOnFocus: true,
            style: {          
                fg: '#787878',
                bg: '#454545',  

                focus: {        
                    fg: '#f6f6f6',
                    bg: '#353535' 
                }
            }
        })
        footer = blessed.text({