3 Replies - 2029 Views - Last Post: 21 October 2012 - 08:29 PM Rate Topic: -----

#1 RETNE  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 17-November 07

Edit command line input

Posted 18 October 2012 - 05:22 PM

Is there a way to move back and forth between characters when reading from the terminal
Is This A Good Question/Topic? 0
  • +

Replies To: Edit command line input

#2 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon



Reputation: 1335
  • View blog
  • Posts: 3,398
  • Joined: 28-November 09

Re: Edit command line input

Posted 18 October 2012 - 05:43 PM

....the arrow keys?
Was This Post Helpful? 0
  • +
  • -

#3 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2013
  • View blog
  • Posts: 3,038
  • Joined: 21-June 11

Re: Edit command line input

Posted 19 October 2012 - 12:05 AM

View PostLemur, on 19 October 2012 - 02:43 AM, said:

....the arrow keys?


... will simply print escape sequences when you press them in response to gets.

@OP: If you require 'readline' and then use Readline.readline to read input, the users will be able to use the left and right arrow keys to navigate through their input. You can also set it up, so that they can use the up and down arrows to recall their previous input.
Was This Post Helpful? 1
  • +
  • -

#4 RETNE  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 17-November 07

Re: Edit command line input

Posted 21 October 2012 - 08:29 PM

View Postsepp2k, on 19 October 2012 - 01:05 AM, said:

View PostLemur, on 19 October 2012 - 02:43 AM, said:

....the arrow keys?


... will simply print escape sequences when you press them in response to gets.

@OP: If you require 'readline' and then use Readline.readline to read input, the users will be able to use the left and right arrow keys to navigate through their input. You can also set it up, so that they can use the up and down arrows to recall their previous input.

thanks that's exactly what I'm looking for
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1