我试图用C语言为一个学校项目编写一个小型shell,我想要做的是做一种命令历史(比如shell),当我按下向上键时,它会将前面的输入写到输入部分,向下做相反的事情……,您可以在按enter键将它发送到程序之前编辑它,例如:[]表示用户游标
my_shell$ some input wrote by me
my_shell$ []
my_shell$ some other input
my_shell$ []
and now if I press UP
my_shell$ some other input[]
If I press UP again
my_shell$ some input wr