<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hi Cyril,</p>
    <p><br>
    </p>
    <p>For the remote execution backend (which is the default) is used,
      I believe the truncation of the variable content is hardcoded, and
      cannot be changed by the user. But for local/in-process execution
      backend, the backend should not truncate the output. So, using the
      local execution might be part of the solution. In the API, it
      could be something like:</p>
    <p>    public static void main(String[] args) {<br>
              {<br>
                  JShell j = JShell.builder().build();<br>
                  for (SnippetEvent evt : j.eval("\"a\".repeat(65536)"))
      {<br>
                      System.err.println("output default execution: " +
      evt.value().length());<br>
                  }<br>
              }<br>
              {<br>
                  JShell j =
      JShell.builder().executionEngine("local").build();<br>
                  for (SnippetEvent evt : j.eval("\"a\".repeat(65536)"))
      {<br>
                      System.err.println("output local execution: " +
      evt.value().length());<br>
                  }<br>
              }<br>
          }<br>
    </p>
    <p><br>
    </p>
    <p>which produces:</p>
    <p>output default execution: 21844<br>
      output local execution: 65538</p>
    <p><br>
    </p>
    <p>For the actual tool, there are feedback mode that define the
      truncation limit (inside the "UI" tool), and these can be set. For
      example:</p>
    <p>$ ./jshell --execution local<br>
      |  Welcome to JShell -- Version 21-internal<br>
      |  For an introduction type: /help intro<br>
      <br>
      jshell> /set mode custom normal -command<br>
      |  Created new feedback mode: custom<br>
      <br>
      jshell> /set truncation custom 2147483647 varvalue,expression<br>
      <br>
      jshell> /set feedback custom<br>
      |  Feedback mode: custom<br>
      <br>
      jshell> "a".repeat(65536)<br>
      $1 ==> "a... very long output<br>
      <br>
    </p>
    <p><br>
    </p>
    <p>Please also note there's a related bugreport:</p>
    <p><a class="moz-txt-link-freetext" href="https://bugs.openjdk.org/browse/JDK-8299829">https://bugs.openjdk.org/browse/JDK-8299829</a></p>
    <p><br>
    </p>
    <p>Thanks,</p>
    <p>    Jan</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 10. 04. 23 15:27, Cyril de Catheu
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:c90e7459a3a123302ca0421ae7a45b697cfdac0b@hey.com">
      
      <meta name="viewport" id="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=10.0,initial-scale=1.0">
      <style>html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}h1{font-size:1.3em;line-height:1.2;margin:0}ul,ol{margin:0;padding:0}ul li,ol li,li li{margin:0 0 0 36px}[dir=rtl] li{margin:0 18px 0 0}blockquote{border-color:#dfdee1;border-style:solid;border-width:0 0 0 1px;margin:0;padding:0 0 0 1em}[dir=rtl] blockquote,blockquote[dir=rtl]{border-width:0 1px 0 0;padding:0 1em 0 0}pre{font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:.9em;margin:0;padding:1rem;background-color:#f6f5f3;white-space:pre-wrap;word-wrap:break-word;overflow:visible}.message-content{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";line-height:1.4}.attachment{display:inline-block;margin:0;padding:0}.attachment__caption{padding:0;text-align:center}.attachment__caption a[href]{text-decoration:none;color:#333}.attachment--preview{width:100%;text-align:center;margin:.625em 0}.attachment--preview img{border:1px solid #dfdee1;vertical-align:middle;width:auto;max-width:100%;max-height:640px}.attachment--preview .attachment__caption{color:#716d7b;font-size:.85em;margin-top:.625em}.attachment--file{color:#282138;line-height:1;margin:0 2px 2px 0;padding:.4em 1em;border:1px solid #dfdee1;border-radius:5px}.permalink{color:inherit}.txt--xx-small{font-size:14px}.flush{margin:0;padding:0}.push--bottom{margin-bottom:8px}.border--top{border-top:1px solid #ece9e6}.btn{padding:.2em .4em;font-weight:500;text-decoration:none;border-radius:3rem;white-space:nowrap;background:#5522fa;border-color:#5522fa;color:#fff}.btn--email{display:inline-block;text-align:center;font-weight:500;font-size:1em;text-decoration:none;border-radius:2em;white-space:nowrap;background:#5522fa;border-color:#5522fa;color:#fff;border-top:.3em solid #5522fa;border-left:1em solid #5522fa;border-bottom:.3em solid #5522fa;border-right:1em solid #5522fa}.shaded{padding:1em;border-radius:4px;background-color:#f6f5f3;border:1px solid #dfdee1}</style>
      <div class="message-content">
        <div class="trix-content">
          <div>Hey, <br>
            I'm a user of jshell, I hope this is the correct mailing
            list for my question.<br>
            It seems jshell snippets value have a character limit. <br>
            <br>
            It can be reproduced in a jshell with the following (sorry
            for the long strings): <br>
            <br>
            jshell> "a".repeat(21842);</div>
          <div>$1 ==>
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
            ...
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<br>
            <br>
            --> notice in the second case the last character is cut.<br>
            So the limit seems to be of around 21842 characters. <br>
            <br>
            This does not look related to the jshell tool, it can also
            be reproduced with a jdk.jshell.JShell instance
            programmatically. It seems to be happening down in the
            ExecutionControl implementation.<br>
            <br>
            This is an issue for me because I'm using functions that
            return html or json that are >>20k characters, so my
            results get broken.<br>
            <br>
            Is there a way to change this limit?<br>
            <br>
            Have a nice day.<br>
            Cyril de Catheu<br>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
  </body>
</html>