Regarding cols class in terminal #5323
anubhavPinewheel
started this conversation in
General
Replies: 2 comments
-
If I remove cols from term then it goes beyond the container of terminal and breaks after a certain point. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Most likely you forgot to resize the underlying PTY on OS side as well. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I ran into an issue I implemented a terminal in my next.js app where before introducing cols i.e. 80 by default it results in typing command in same line after width space get finished and at certain point it breaks the line. so I dynamically calculated the width and lets say it 53 now, it allow me to break lines when one single line get filled but it cause another issues like overriding on same line backspace is not working after ending a line.
2025-03-27.17-38-40.online-video-cutter.com.mp4
`const calculateDimensions = () => {
const containerWidth = divRef.current?.clientWidth || window.innerWidth;
const charWidth = 10;
return {
cols: Math.max(10, Math.floor((containerWidth - 40) / charWidth)),
};
};
Help me out
Beta Was this translation helpful? Give feedback.
All reactions