Context: I am trying to make a terminal using tkinter out of textbox. One of the properties of a terminal is once you have executed a line of code (after hitting enter), you will not be able to make edits/type something on the previous lines, but you can type something on the new line (after execution). You will also not be able to edit the output given and also the starting parameter of the terminal.
Example: https://i.stack.imgur.com/Ptuok.png
I will not be able to edit or write anything into the characters and lines I circled: https://i.stack.imgur.com/MMmQq.png. But I am able to type in something on the new line after the characters "C:\>"
Question: So how am I able to achieve this using tkinter inside a textbox? In my case, I should not be able to edit/make changes to the characters, "C:\>" and also previous sentences (Includes input and outputs)
Research: I did some research and you could use "state=DISABLED" but it prevents you from modifying changes to the entire textbox
My Code for now:
from tkinter import *
def enter(event):
def insert():
tfield.insert("end", ">>>")
root.after(10, insert)
root = Tk()
tfield = Text(root, bg='black', fg='white')
tfield.pack()
tfield.bind("<Return>", enter)
root.mainloop()