{"action":"created","issue":{"url":"https://api.github.com/repos/dbcli/pgcli/issues/221","labels_url":"https://api.github.com/repos/dbcli/pgcli/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/dbcli/pgcli/issues/221/comments","events_url":"https://api.github.com/repos/dbcli/pgcli/issues/221/events","html_url":"https://github.com/dbcli/pgcli/issues/221","id":70525965,"number":221,"title":"Format of pasted query","user":{"login":"kentor","id":240493,"avatar_url":"https://avatars.githubusercontent.com/u/240493?v=3","gravatar_id":"","url":"https://api.github.com/users/kentor","html_url":"https://github.com/kentor","followers_url":"https://api.github.com/users/kentor/followers","following_url":"https://api.github.com/users/kentor/following{/other_user}","gists_url":"https://api.github.com/users/kentor/gists{/gist_id}","starred_url":"https://api.github.com/users/kentor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentor/subscriptions","organizations_url":"https://api.github.com/users/kentor/orgs","repos_url":"https://api.github.com/users/kentor/repos","events_url":"https://api.github.com/users/kentor/events{/privacy}","received_events_url":"https://api.github.com/users/kentor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-23T22:13:49Z","updated_at":"2015-04-24T06:29:33Z","closed_at":null,"body":"When I paste a query with line breaks into pgcli, the lines are joined without a space.\r\n\r\nfor example:\r\n\r\n```\r\nselect col\r\nfrom table\r\n```\r\n\r\nbecomes\r\n\r\n`select colfrom table`\r\n\r\nwhich is a syntax error"},"comment":{"url":"https://api.github.com/repos/dbcli/pgcli/issues/comments/95817481","html_url":"https://github.com/dbcli/pgcli/issues/221#issuecomment-95817481","issue_url":"https://api.github.com/repos/dbcli/pgcli/issues/221","id":95817481,"user":{"login":"amjith","id":49260,"avatar_url":"https://avatars.githubusercontent.com/u/49260?v=3","gravatar_id":"","url":"https://api.github.com/users/amjith","html_url":"https://github.com/amjith","followers_url":"https://api.github.com/users/amjith/followers","following_url":"https://api.github.com/users/amjith/following{/other_user}","gists_url":"https://api.github.com/users/amjith/gists{/gist_id}","starred_url":"https://api.github.com/users/amjith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amjith/subscriptions","organizations_url":"https://api.github.com/users/amjith/orgs","repos_url":"https://api.github.com/users/amjith/repos","events_url":"https://api.github.com/users/amjith/events{/privacy}","received_events_url":"https://api.github.com/users/amjith/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T06:29:33Z","updated_at":"2015-04-24T06:29:33Z","body":"Actually in order to paste multi-line strings like the one in the example, you have to enable the multi-line mode (F3 key). \r\n\r\nIf you notice the syntax error says \r\n\r\n```\r\nmisago> select colfrom table\r\ncolumn \"col\" does not exist\r\nLINE 1: select col\r\n```\r\n\r\nEven though it printed it as `select colfrom table` what it actually did was it pasted `select col` and the newline after that was treated as <enter> and it sent the partial query to the server and then pasted the rest of the query into the buffer. \r\n\r\nBut if you enable multiline-mode and then paste the same snippet, it will be pasted correctly and then you can end it with a semicolon and press enter to execute the query. \r\n\r\nTry it out and let me know if it works. "}}