Guest User

Untitled

a guest
Jul 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.02 KB | None | 0 0
  1. 16:25 < vokoda> which program sends information like terminal size over an openssh connecton?
  2. 16:25 < exarkun> vokoda: which program?
  3. 16:26 < glyph> exarkun: I think he means, is it bash's job, or sshd's job, or the kernel's job
  4. 16:26 < glyph> exarkun: and I'm slightly curious too
  5. 16:26 < foom> the kernel sends a SIGWINCH to ssh
  6. 16:26 < SpComb> perhaps ssh has a tty?
  7. 16:26 < vokoda> glyph: yes, that's what I meant
  8. 16:26 < foom> ssh sends it over the ssh connection to the sshd
  9. 16:26 < foom> the sshd configures the tty on the remote end, and that results in a SIGWINCH going to the remote bash
  10. 16:27 < glyph> foom: really, it's the kernel? It's not like xterm?
  11. 16:28 < exarkun> when you resize the xterm, it configures the tty
  12. 16:28 < exarkun> that results in the local SIGWINCH
  13. 16:28 < foom> xterm sets the tty's rows/cols.
  14. 16:28 < exarkun> from the kernel
  15. 16:28 < foom> the kernel sends SIGWINCH when that happens.
  16. 16:29 < glyph> what's the API for xterm's side of things? some ioctls?
  17. 16:29 < exarkun> ioctl TIOCGWINSZ
  18. 16:29 < glyph> heh
  19. 16:29 < glyph> in 20 minutes I maybe even would have thought to look at that
  20. 16:30 < exarkun> actually that's for getting the size, sorry
  21. 16:30 < glyph> Does the kernel actually have an idea of what characters are on the screen of a given PTY?
  22. 16:30 < exarkun> I meant TIOCSWINSZ obviously.
  23. 16:30 < glyph> exarkun: obviously, it was implied.
  24. 16:30 < foom> nope
  25. 16:30 < foom> it sends them across and forgets
  26. 16:30 < glyph> foom: OK, I thought not.
  27. 16:30 < glyph> I just didn't realize that it actually remembered the height and width.
  28. 16:30 < foom> stty -a
  29. 16:30 < glyph> Although my brief encounter with TIOCGWINSZ should have taught me that.
  30. 16:30 < foom> it remembers all sorts of crap
  31. 16:30 < exarkun> staaaaate
  32. 16:31 < vokoda> thanks foom, interesting
  33. 16:31 * glyph blinks
  34. 16:31 < glyph> foom: thanks
  35. 16:31 < foom> It's rather astounding how much kernel crap is involved with displaying a bash in an xterm window.
  36. 16:31 < glyph> foom: Less kernel crap than displaying cmd.com in a ... window, if you can call it that
  37. 16:31 < exarkun> video memory region
  38. 16:32 < glyph> (sorry I know it's actually cmd.exe it's just _sooooo_ busted)
  39. 16:32 < glyph> exarkun: I think in win7 it might actually be a window instead of a pointer to some kernel memory
  40. 16:33 < foom> yes, windows is even awesomer. What with the ANSI terminal emulation also being in the kernel and all.
  41. 16:34 < glyph> yeah, windows hella knows what characters are in your terminal
  42. 16:34 < glyph> and I think in your scrollback buffer, even
  43. 16:35 < exarkun> because they're not really in your terminal
  44. 16:35 < exarkun> they're in cmd.exe and you just get to look at them sometimes
  45. 16:36 < foom> Are they really in cmd.exe? Somehow it can also output to a pipe.
  46. 16:37 < foom> Does libc loads up ansi.sys into the cmd.exe's process space if it's outputting to a terminal?
  47. 16:37 < exarkun> I guess I probably don't know how it really works anymore
  48. 16:37 < exarkun> but I think as soon as pipes are involved, everything changes
  49. 16:38 < exarkun> that is, you have to ask for stdio in a program
  50. 16:38 < glyph> no, you need command.com to use ansi.sys
  51. 16:38 < glyph> cmd.exe does colors some other way
  52. 16:38 < exarkun> and when you do that, all the rules change
  53.  
  54.  
  55.  
  56. <zykes-> how is PB differencing from say AMP ?
  57. <exarkun> In a lot of ways [17:34]
  58. <zykes-> mains are ?
  59. <glyph> AMP is simpler to implement, easier to implement cross-language data
  60. structures, possibly more secure (although that is a complicated
  61. conversation), probably simpler to optimize [17:35]
  62. <glyph> PB is easier to implement complex state-sharing protocols with, easier
  63. to address individual objects with in a large object graph
  64. [17:36]
  65. <zykes-> guess i'll keep with AMP then :)
  66. <glyph> I generally tend to recommend AMP [17:37]
  67. <exarkun> I don't know if there's any reason for new development to use PB.
  68. <zykes-> why not exarkun ? :p
  69. <exarkun> AMP does enough, and simpler is always better. [17:38]
  70. <zykes-> can i use amp with ssl ? [17:39]
  71. <exarkun> yes
  72. <zykes-> kk
Add Comment
Please, Sign In to add comment