Closed mcollina closed 7 years ago
Hmm, I have a program that I created where I paste into prompt-sync almost daily, so i know it works fine in at least one configuration. Can you add some detail?
Mac OS X, tmux, iTerm2 (v3), node v4.4.5 and this code:
'use strict'
const prompt = require('prompt-sync')()
const n = prompt('Hello? ')
console.log(n)
yah I'm able to reproduce - OS x, iterm 3 (not using tmux), node 6
this could be tricky - the awesome thing about prompt-sync is no native dependencies, not sure how we fix this without using native deps
I mean - sure you we can tap into pbcopy/pbpaste, xclip etc., and we can detect cmd+v / ctrl + v but not sure how we cover right click & paste (or edit menu -> paste) etc.
Still confused, my pxx program works perfectly, I paste into it every day, it's worked for over a year, different versions of node and iTerm, are we talking about different things?
I take that back, pxx isn't using prompt-sync... Hmm, not sure what I'm using prompt-sync for any more ;)
@davidmarkclements ok, so i just cloned and took a quick look. i copied some text and tried to paste it. What happens is that i get a single character of the text that i copied. For instance if i copy FOO
, it only pastes O
. I think this just needs to detect the paste key combination and then insert that value into the buffer.
ok just looked into real quick and it's totally fixable - it's because we assume one character per stdin buffer - all we have to do is analyse the buffer a little more and do the right thing (it currently already detects a 3 char input for control characters, we just do something similar for paste)
As titled, pasting something into
prompt-sync
does not work :(. I'm using node v4.4.5.cc @davidmarkclements