News for hackers. Stuff that matters.
Re:Tmux is worse-is-better by fiddlerwoaroof on Saturday May 25, 2024 @02:53PM (#40477055)
I like how iTerm2 can act as a UI for tmux via tmux’s control protocol. We don’t need to reinvent tmux to fix some of the UX issues of tmux sessions inside terminal tabs inside terminal windows.
Re:Tmux is worse-is-better by lathiat on Saturday May 25, 2024 @07:07PM (#40478501)
This is my favourite, I use it all the time. There's a couple bugs that show up but it's really good. Having real local tabs for a remote SSH is great.
Re:Tmux is worse-is-better by BeefySwain on Saturday May 25, 2024 @07:11PM (#40478522)
Anyone know of a terminal for Linux with this feature?
Re:Tmux is worse-is-better by fiddlerwoaroof on Saturday May 25, 2024 @07:40PM (#40478672)
I haven’t found a great Linux terminal: it’s one of the things that really makes it hard for me to use Linux
Re:Tmux is worse-is-better by naikrovek on Saturday May 25, 2024 @07:49PM (#40478705)
What? Xterm is amazing.
Re:Tmux is worse-is-better by coldtea on Saturday May 25, 2024 @08:40PM (#40478904)
Parent means with those kind of features something like iTerm has
Re:Tmux is worse-is-better by fiddlerwoaroof on Saturday May 25, 2024 @09:13PM (#40479050)
iTerm2 has a ton of quality of life features that no alternate terminal comes close to: automatically detecting tables in output and handling copy/paste correctly. Quick navigation between shell prompts, etc.

If emacs wasn’t really slow with long lines in buffers and high volume output, it could be better

Re:Tmux is worse-is-better by dmd on Saturday May 25, 2024 @11:55PM (#40479681)
> automatically detecting tables in output

What is this? I've been using iterm2 for years and don't know about this (and can't seem to find anything mentioning it).

Re:Tmux is worse-is-better by fiddlerwoaroof on Sunday May 26, 2024 @12:00AM (#40479704)
https://apple.stackexchange.com/questions/364888/how-can-i-l...

“Tables” is imprecise, but is one use-case: it’s more about identifying soft boundaries like the lines between tmux or vim splits and limiting the selection to one side of the split. If you have pipe-delimited tables, it lets you select a single column of values.

Re:Tmux is worse-is-better by dmd on Sunday May 26, 2024 @09:22AM (#40481970)
!!! THANK YOU !!! (and George Nachman) I had no idea this existed and this is a dozens-of-times-daily pain point for me.
Re:Tmux is worse-is-better by naikrovek on Saturday May 25, 2024 @11:50PM (#40479669)
The correct way to handle copy and paste in a terminal is to copy what is selected verbatim and to paste whatever is in the clipboard verbatim.

Interpretation of intent and “helping” the user are neither needed nor desired, and at best leave everything alone and at worst misinterpret and get in the way.

I have never copied anything out of a terminal and gotten anything other than what I copied when I pasted into sublime text, and I’ve never used iterm2.

Are you talking about copying from a terminal and pasting into OneNote or some other “more than plain text” application or something?

Re:Tmux is worse-is-better by fiddlerwoaroof on Saturday May 25, 2024 @11:59PM (#40479697)
No, I’m talking about noticing that you have a tmux or vim split and restricting the selection to one side or another of the split so that you can select the actual text rather than some random nonsensical text.

This is the single feature I miss the most in any other terminal emulator.

Re:Tmux is worse-is-better by naikrovek on Sunday May 26, 2024 @12:11AM (#40479734)
Ah, ok. I don’t use tmux or any other multiplexer, I handle that problem differently.
Re:Tmux is worse-is-better by iforgotpassword on Sunday May 26, 2024 @03:41AM (#40480347)
I prefer manual control. Simply holding down Ctrl while selecting creates a rectangular selection in pretty much every terminal, which works in all those cases.
Re:Tmux is worse-is-better by DEADMINCE on Sunday May 26, 2024 @04:15AM (#40480482)
People tend to get attached to certain methods/ways and then defend that no matter what.
Re:Tmux is worse-is-better by chalupaman on Monday May 27, 2024 @03:35AM (#40488541)
At least in the terminals I’ve used so far, holding down Ctrl causes you select the displayed form, not the verbatim form of what you’re highlighting. That is, if you’re in vim looking at a file with 10 long lines, selecting them this way will only select the portion that fits onto your screen, not the entire lines. And if your editor visually wraps them so they do fit on the screen, selecting this way will introduce unwanted line breaks, such that copying 10 lines and pasting can create 23 lines.

The iTerm2 feature being discussed means that selecting works the same way it does for graphical programs like Gedit or Pycharm or Word — if you select 10 lines you select 10 lines and your window size, font size and visual wrap setting don’t factor into it, and when you paste, you paste what you copied as it was. I would say this is the intuitive and reasonable behavior, but it’s one that is not simple to implement. A visual word wrap should be a purely visual thing and s back to back Cut and Paste should result in nothing changing.

Re:Tmux is worse-is-better by iforgotpassword on Tuesday May 28, 2024 @04:26AM (#40498636)
Good point, didn't think of that, probably not encountering that case often enough in my workflow.
Re:Tmux is worse-is-better by tremon on Monday May 27, 2024 @07:50AM (#40489930)
copy what is selected verbatim

Does that include all trailing whitespace in the rectangle you selected? Should your selection automatically minimize to unselect said trailing whitespace (even before copying, I mean)? Should a selection preserve tab characters or replace them with spaces? What if the selection does not start at a tab boundary, should it ignore or include the half-selected tab instance?

I don't think there is a singular answer to what "copy selection verbatim" means.

Re:Tmux is worse-is-better by haskman on Sunday May 26, 2024 @01:23AM (#40479943)
I just tried with kitty, and konsole, on linux and selecting text within a tmux split works perfectly. So does copy-paste (use Ctrl-Shift-C instead of Ctrl-C).
Re:Tmux is worse-is-better by fiddlerwoaroof on Sunday May 26, 2024 @11:53AM (#40483125)
Is this through tmux’s mouse mode? Can you select three lines of only the left side of the session? Does this also work in vim and other places that draw soft boundaries on the screen?

A couple years ago, I tried this in kitty and a couple other Linux terminals and none of them implemented this.

Re:Tmux is worse-is-better by haskman on Sunday May 26, 2024 @03:43PM (#40484782)
Yes I see what you mean. I have tmux mouse mode enabled which makes this possible. This works in nvim as well because it also has mouse support. Presumably iTerm supports selecting text in a single pane even when you have mouse mode turned off.

IMO this setting belongs with the application, and especially with tmux and nvim supporting this natively, you don't really need the terminal itself to implement some potentially fallible heuristic. For example with iTerm if you accidentally drag outside the pane boundary, the selection immediately expands to include both the panes, which is not ideal.

Re:Tmux is worse-is-better by fiddlerwoaroof on Sunday May 26, 2024 @04:02PM (#40484909)
I like it because I can design programs to output pipe-delimited tables and selection works correctly (I also hate terminal apps that use the mouse and disable mouse mode everywhere so that mouse selection in the terminal works predictably)
Re:Tmux is worse-is-better by mgkimsal on Sunday May 26, 2024 @02:38PM (#40484362)
"handling copy/paste correctly."

Sometime in the last year, iterm2 started adding ~00~ crap around stuff I paste. then some yellow 'alert' box at the top indicating I'm doing something wrong and do I want to keep doing it. makes 0 sense to me, and... annoying because it didn't do it for the first... 6-7+ years I used it. My behaviour didn't change, but iterm2 starts breaking.

No doubt there's some 100% logical explanation as to what changed such that my standard copy/paste is 'wrong' now, but... would have preferred they'd have kept the original behaviour.

Re:Tmux is worse-is-better by fiddlerwoaroof on Sunday May 26, 2024 @04:01PM (#40484899)
This is probably the bracketed paste feature: https://invisible-island.net/xterm/xterm-paste64.html

There’s a toggle in the terminal settings

Re:Tmux is worse-is-better by ColCh on Monday May 27, 2024 @05:56PM (#40495137)
Just wanted to note for everybody who really loves this feature. There is some options here though

Wezterm terminal supports multiplexing from the box: https://wezfurlong.org/wezterm/multiplexing.HTML

Also, there is Hyper terminal, and standalone protocol to implement multiplexing https://www.reddit.com/r/commandline/comments/q5mj11/htm_a_c...

If you know other options, please share.

I work in windows, but at home I use macos, so I stick to wezterm. I use it with single config for both platforms (config is written in Lua)

Re:Tmux is worse-is-better by mashrooms on Tuesday May 28, 2024 @12:51AM (#40497433)
Wezterm does not have good enough multiplexing like tmux. such like you have not easy way to switch/create sessions.