mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Provide #h for short hostname (no domain) from Michal Mazurek.
This commit is contained in:
		
							
								
								
									
										7
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								status.c
									
									
									
									
									
								
							@@ -410,6 +410,13 @@ status_replace1(struct client *c, struct session *s, struct winlink *wl,
 | 
			
		||||
			fatal("gethostname failed");
 | 
			
		||||
		ptr = tmp;
 | 
			
		||||
		goto do_replace;
 | 
			
		||||
	case 'h':
 | 
			
		||||
		if (gethostname(tmp, sizeof tmp) != 0)
 | 
			
		||||
			fatal("gethostname failed");
 | 
			
		||||
		if ((ptr = strchr(tmp, '.')) != NULL)
 | 
			
		||||
			*ptr = '\0';
 | 
			
		||||
		ptr = tmp;
 | 
			
		||||
		goto do_replace;
 | 
			
		||||
	case 'I':
 | 
			
		||||
		xsnprintf(tmp, sizeof tmp, "%d", wl->idx);
 | 
			
		||||
		ptr = tmp;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.1
									
									
									
									
									
								
							@@ -2005,6 +2005,7 @@ may contain any of the following special character sequences:
 | 
			
		||||
.It Li "#(shell-command)" Ta "First line of the command's output"
 | 
			
		||||
.It Li "#[attributes]" Ta "Colour or attribute change"
 | 
			
		||||
.It Li "#H" Ta "Hostname of local host"
 | 
			
		||||
.It Li "#h" Ta "Hostname of local host without the domain name"
 | 
			
		||||
.It Li "#F" Ta "Current window flag"
 | 
			
		||||
.It Li "#I" Ta "Current window index"
 | 
			
		||||
.It Li "#P" Ta "Current pane index"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user