r/termux • • 1d ago

Showcase Code IDE inside termux

Hi, just wanted to swing by and mention how impressive termux is.
After trying it out, I wanna give a huge thank you to all the folks who make this possible! I've discovered the joy of developing on android device that gives me so many more hours of battery life and a way smoother experience reviewing code.


I am a maintainer of TTT editor, an open source terminal IDE. A dev a few months ago asked for a build for android termux. I was like sure, why not! Did a quick check on my phone to make sure it works and that was it.

I've got a tablet recently and got to try it out myself. The recording you see is me trying a few features: editing, search, global search, changes panel, terminal and debugger. Debugger hasn't been released yet, it's only available on main. In just a few minutes I was able to have go, gopls and delv installed and working. Even on some desktop machines, that takes longer with the quirks of some package managers.

There are a few quirks, dragging doesn't work with finger, that doesn't seem to be a termux issue but more like a physical touchscreen limitation. Connecting a mouse did allow me to resize the panels without using shortctus. On the phone I am not sure it works that well with limited screen size. You can hide the sidebar but the screen size limits the experience, unless you zoom out but then it's hard to see.

On the tablet tablet with a keyboard and mouse the experience is identical to a desktop environment, and that is a testamente to all the amazing work folks who work on termux did.
I'm really excited because I can put my 5 year old surface laptop to rest and use a tablet for development that gets me like 10 hours of battery.

If you do try TTT and find other issues, please do create an issue in github.com/eugenioenko/ttt
You can also download ttt at tttedit.dev

I'll be fixing the ones I find, but my workflows might differ from yours, so really appreciate it if you do.

One thing I still have to figure out is a portable keyboard, not sure if to go for a full size one or more like a tiny blackberry like one. (Problems for another day)

See ya!

92 Upvotes

7 comments sorted by

2

u/Ngtuanvy 1d ago

swiping should work, as far as I know Termux sends terminal control sequences for mouse and there is no reason it shouldn't work. Opencode and Neovim works fine.

1

u/FitDirector3051 1d ago edited 1d ago

Thank you for the clue. I don't mean swiping but dragging the divider. I just tried herdr and lazygit, and both resize the left pane with mouse just fine. Not with finger though 

Is there a config I am missing?

Edited: Okey, mystery solved (I think):

https://github.com/termux/termux-app/blob/5b657c6adf4304e5198951ce815fe0205dcac29c/terminal-view/src/main/java/com/termux/view/TerminalView.java#L172

Termux sends only mouse down when mouse is active otherwise it sends scroll. And that's the issue. No drag (mouse down and move) with single finger.

I wonder now if that would be a good feature and...

It has been requested in like 2020. Time to revisit? https://github.com/termux/termux-app/issues/1384

1

u/itsKreisler 1d ago

What sets it apart from https://getfresh.dev/?

2

u/FitDirector3051 23h ago edited 23h ago

Hi! A lot. Fresh imho is about having IDE functionality within the terminal. TTT is about having GUI IDE feel inside the terminal. Same space, similar goals very different approach.  

Best way to see the diff is trying them out :)

There are a also a bunch of technical tradeoffs both editors do differently. Here a few cool ones: 

Fresh lazy loads files after 10 Mb and optimizes for large file sizes, and doesn't calculate initially amount of lines. Which  makes it load 1kb file and 100gb file at constant time. Impressive. Tradeoff is that the scrollbar is scrolling for bytes, until line count is asked for.  Nvim and ttt do not lazy load. This means opening larger files takes longer and you can run out of memory. The tradeoff is that opening average code files is faster. Code files are mostly 1-100kb range.

Very soon TTT is shipping DAP support which will enable debugging for go, node, c, c#, assembly, python and rust. (Plus others). It's already on main. 

Plugin system is also very different. Not only language difference of js vs lua but specifically ttt plugin system methods run sandboxed and when installing plugins permission are requested: what binaries are allowed to be executed, what urls are allowed for http requests, keyboard access, editor access. Its very granular but as a user you can get an idea of what the plugin could do without accessing source code. 

I like to think of the terminal as the app and the binaries as widgets. Split the terminal in two, and run them side by side :)  

2

u/ddk070 15h ago edited 14h ago

Omg.It worked. I can't believe I'll be using an GUI editor in termux someday.

1

u/RobertDeveloper 23h ago

I use intellij idea ultimate in proot

1

u/mochorro 10h ago

Oh, nice project, mate! A long time ago I had a similar idea: an IDE in the terminal that feels like a smooth GUI from traditional IDEs. I also really liked that you used Golang for development.