Coder Social home page Coder Social logo

Pasting does not work about prompt-sync HOT 9 CLOSED

heapwolf avatar heapwolf commented on August 13, 2024
Pasting does not work

from prompt-sync.

Comments (9)

heapwolf avatar heapwolf commented on August 13, 2024

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?

from prompt-sync.

mcollina avatar mcollina commented on August 13, 2024

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)

from prompt-sync.

davidmarkclements avatar davidmarkclements commented on August 13, 2024

yah I'm able to reproduce - OS x, iterm 3 (not using tmux), node 6

from prompt-sync.

davidmarkclements avatar davidmarkclements commented on August 13, 2024

this could be tricky - the awesome thing about prompt-sync is no native dependencies, not sure how we fix this without using native deps

from prompt-sync.

davidmarkclements avatar davidmarkclements commented on August 13, 2024

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.

from prompt-sync.

heapwolf avatar heapwolf commented on August 13, 2024

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?

from prompt-sync.

heapwolf avatar heapwolf commented on August 13, 2024

I take that back, pxx isn't using prompt-sync... Hmm, not sure what I'm
using prompt-sync for any more ;)

from prompt-sync.

heapwolf avatar heapwolf commented on August 13, 2024

@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.

from prompt-sync.

davidmarkclements avatar davidmarkclements commented on August 13, 2024

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)

from prompt-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.