Cursor Blinking Style #279
Replies: 1 comment 5 replies
-
Hello, In general, I think that this is a good idea, there are a few things to keep in mind. There is already a set of cursor styles in SwiftTerm which correspond to the settings that users can configure via escape sequences. Look at the The secondary issue that you will run into is that the cursor rendering in SwiftTerm is not great (#219). It is just a UIView on top of the terminal. This makes it very easy to implement the blinking, but also it means that you are limited in what the cursor can do. And in fact, you will notice that a fully filled cursor tends to completely obscure the text, rather than providing the nice behavior that your screenshots show. There are two possible solutions to this problem:
Option (1) has I suspect assorted corner cases, but also would allow SwiftTerm to get support for cursor foreground/background colors, which I currently ignore. Option (2) is likely faster for you to get up to speed, and it is an acceptable band-aid for the short term, and can always be revisited. |
Beta Was this translation helpful? Give feedback.
-
We use SwiftTerm in CodeEdit and we are wanting to offer similar cursor blinking styles seen in VS Code both in our editor which uses STTextView, and in our Terminal. The blink styles offered by VS Code are:
We might experiment to offer other variations of these (maybe phase+expand for example).
After some discussion with @bombardier200 and a few other of our contributors we may be able to contribute more as we have a growing interest in this projects development. This seems like it would need to be done at the SwiftTerm level the way I see it currently. We could include this in SwiftTerm, but we'd like to be consistent in our implementation between our editor and terminal so it may be good to make this possible externally.
I’d imagine there are many possible ways this can be configured. We might provide the following configurations, we could even use these configurations internally to create presets.
@migueldeicaza What are your thoughts? Is this something we could build into SwiftTerm?
Beta Was this translation helpful? Give feedback.
All reactions