title: When using telnet client, after using .exec command, I want to press enter key, but don't know how to do this
body: <p>I am trying to connect to a router that is running on gns3 using telnet. After successful connection i want to execute some commands and want to press enter key after each command.</p>
  <p>here is my code:</p>
  <pre><code>const myFunc = async () =&gt; {
    const connection = new Telnet();
  
    // these parameters are just examples and most probably won't work for your use-case.
    const params = {
      host: &quot;localhost&quot;,
      port: 5000,
      shellPrompt: &quot;&gt;&quot;, // or negotiationMandatory: false
      timeout: 1500,
    };
  
    try {
      await connection.connect(params);
    } catch (error) {
      // handle the throw (timeout)
      console.log(`error: ${error}`);
    }
  
    const res = await connection.exec(&quot;enable&quot;);
  
    //here i want to press enter key
  
    const res1 = await connection.exec(&quot;show running-config&quot;, {
      shellPrompt: &quot;#&quot;,
    });
    
    //here i want to press enter key
    console.log(`res1: ${res1}`);
  };
  </code></pre>
  <p>After running this code, it successfully connects to router and then run the first command enable.</p>
  <p><a href="https://i.stack.imgur.com/dtYdK.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>But it is not sending the enter key that why i receive the error:</p>
  <p><a href="https://i.stack.imgur.com/b1jbX.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>Please guide me, how to resolve the issue.</p>