How to start a terminal with certain text already input on the command-line?

You can do this with expect (install). Create and make executable ~/bin/myprompt:

#!/usr/bin/expect -f

# Get a Bash shell
spawn -noecho bash

# Wait for a prompt
expect "$ "

# Type something
send "my text to be posted"

# Hand over control to the user
interact

exit

and run Gnome Terminal with:

gnome-terminal -e ~/bin/myprompt

ændrük's suggestion is very good and worked for me, however the command is hardcoded within the script, and if you resize the terminal window it doesn't work well. Using his code as the base, I've added the ability to send the myprompt script the command as an argument, and this script correctly handles resizing the terminal window.

#!/usr/bin/expect

#trap sigwinch and pass it to the child we spawned
#this allows the gnome-terminal window to be resized
trap {
 set rows [stty rows]
 set cols [stty columns]
 stty rows $rows columns $cols < $spawn_out(slave,name)
} WINCH

set arg1 [lindex $argv 0]

# Get a Bash shell
spawn -noecho bash

# Wait for a prompt
expect "$ "

# Type something
send $arg1

# Hand over control to the user
interact

exit

and run Gnome Terminal with:

gnome-terminal -e "~/bin/myprompt \"my text to be posted\""

If I understand correctly, you want your first input line to be prefilled to contents that you pass on the gnome-terminal command line.

I don't know how to do exactly this with bash, but here's something that comes close. In your ~/.bashrc, add the following line at the very end:

history -s "$BASH_INITIAL_COMMAND"

Run gnome-terminal -x env BASH_INITIAL_COMMAND='my text to be posted' bash, and press Up at the prompt to recall the text.

Note also that if you put set -o history followed by comments at the end of your .bashrc, they will be entered into the history as bash starts, so you can use them as a basis for editing by reaching them with the Up key and removing the initial #.