unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* send-string-to-terminal truncates the string to length 17384
@ 2018-08-20 17:39 Amos Bird
  0 siblings, 0 replies; only message in thread
From: Amos Bird @ 2018-08-20 17:39 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-20 17:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-20 17:39 send-string-to-terminal truncates the string to length 17384 Amos Bird

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).