From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Amos Bird Newsgroups: gmane.emacs.help Subject: send-string-to-terminal truncates the string to length 17384 Date: Tue, 21 Aug 2018 01:39:54 +0800 Message-ID: <87sh395445.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: blaine.gmane.org 1534792415 3053 195.159.176.226 (20 Aug 2018 19:13:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Aug 2018 19:13:35 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 20 21:13:31 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frpcJ-0000fH-0c for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Aug 2018 21:13:31 +0200 Original-Received: from localhost ([::1]:48839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frpeP-0002P1-I0 for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Aug 2018 15:15:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fro9s-0007CO-Tj for help-gnu-emacs@gnu.org; Mon, 20 Aug 2018 13:40:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fro9p-000321-94 for help-gnu-emacs@gnu.org; Mon, 20 Aug 2018 13:40:04 -0400 Original-Received: from mail-pl0-x22f.google.com ([2607:f8b0:400e:c01::22f]:42319) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fro9n-000313-TU for help-gnu-emacs@gnu.org; Mon, 20 Aug 2018 13:40:00 -0400 Original-Received: by mail-pl0-x22f.google.com with SMTP id g23-v6so4494612plq.9 for ; Mon, 20 Aug 2018 10:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=b6WBlPlcKxQwSZ++WGAaqGuDmLkZCeL7bnAXbDGM/YI=; b=feBYkH3IzGbP9Ei5vLjs8uUCn6WEVDxl3fWUYDqZXKeCVGOV8h8MTXZkaMYjE6cvQp aqgnL8DJF18MvYzg7xjGQ3INVGNfOeuFHyvaww7oOgDmqZlzoA/xq1++3zC6WiBS1Apw dIxuoPWV7yMvtEtQeRM1AFOmBugQuTFcqL4o/yfbJIAh1trwaoY/coK6ZXGaUXbgpN23 Lh9wN/RfqoaIRgQqyS/gyRvt1/lZTh2DExtEgpi8w632VP1iV+IAFwRlH3qlckf1F1fY 5aGgM8Ok/ioxPtn8fKikQ3oHy0zs/2L8utfdRdyXmbbDASDM8RvHHNzDb3Hb0d2Itgcn AEiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=b6WBlPlcKxQwSZ++WGAaqGuDmLkZCeL7bnAXbDGM/YI=; b=qCt4mgACIZJvd5fKyN4f+7paYlEbhNn9jGvATkL3eARcaXJKy2N3/fFR0gXkTtSlEF eod+ehKiD7vSMb4R96LYBCuFqfrGMS/V1NPkap4AqQZ3ftzBEV8YMwAupgibtw2RGVCa ftv1vMA1126rRWZDZIIrbe6OHC3GlOdgT8UnvAufGFes15ypOEj4ZJlOqYYk8ZM3Q99g roLYuSp5Uylah7U1zs71MKDb9k0yF+TQY2JIu1z9s17b9I0V7C//Yb3S5afiSGL4IFkh 5jmtSxX75su5qmyCLfiHjVDdq91t8Gsd076S1OFMshskHixyVl7Z3RQ/Sk5NeCqoD2nm 8HaA== X-Gm-Message-State: AOUpUlEj8uBS5Y0andT3CyAee14JbfJmaz63hszUzGExRTgBMfnGI4Vf SJtBFL0vEKEc4GYr/1nz7wbOYK11sKI= X-Google-Smtp-Source: AA+uWPyKKP8MmyqALEjBpQzgNh3dxQYlsCFZk2o4ppjkPZGZGOQZNIDwFGU4oPHF/mu7svYbrR2AsA== X-Received: by 2002:a17:902:8506:: with SMTP id bj6-v6mr45920556plb.210.1534786798500; Mon, 20 Aug 2018 10:39:58 -0700 (PDT) Original-Received: from localhost ([168.235.105.19]) by smtp.gmail.com with ESMTPSA id 84-v6sm21959609pfj.33.2018.08.20.10.39.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Aug 2018 10:39:57 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::22f X-Mailman-Approved-At: Mon, 20 Aug 2018 14:58:14 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117703 Archived-At: Hi, I use send-string-to-terminal as a osc52 clipboard content generator. However it seems to have a implicit uplimit on the string size, which I don't find by looking at the source code. ``` DEFUN ("send-string-to-terminal", Fsend_string_to_terminal, Ssend_string_to_terminal, 1, 2, 0, doc: /* Send STRING to the terminal without alteration. Control characters in STRING will have terminal-dependent effects. Optional parameter TERMINAL specifies the tty terminal device to use. It may be a terminal object, a frame, or nil for the terminal used by the currently selected frame. In batch mode, STRING is sent to stdout when TERMINAL is nil. */) (Lisp_Object string, Lisp_Object terminal) { struct terminal *t = decode_live_terminal (terminal); FILE *out; /* ??? Perhaps we should do something special for multibyte strings here. */ CHECK_STRING (string); block_input (); if (t->type == output_initial) out = stdout; else if (t->type != output_termcap && t->type != output_msdos_raw) error ("Device %d is not a termcap terminal device", t->id); else { struct tty_display_info *tty = t->display_info.tty; if (! tty->output) error ("Terminal is currently suspended"); if (tty->termscript) { fwrite_unlocked (SDATA (string), 1, SBYTES (string), tty->termscript); fflush_unlocked (tty->termscript); } out = tty->output; } fwrite_unlocked (SDATA (string), 1, SBYTES (string), out); fflush_unlocked (out); unblock_input (); return Qnil; } ``` I'm using libvte to test the issue. Sending the string directly from terminal or inside tmux works fine. It gets truncated when sending via emacs's send-string-to-terminal. Any ideas? Thanks! regards, -- Amos Bird amosbird@gmail.com