all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Amos Bird <amosbird@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: send-string-to-terminal truncates the string to length 17384
Date: Tue, 21 Aug 2018 01:39:54 +0800	[thread overview]
Message-ID: <87sh395445.fsf@gmail.com> (raw)

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



                 reply	other threads:[~2018-08-20 17:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sh395445.fsf@gmail.com \
    --to=amosbird@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.